Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow translating the module #203

Closed
GravendeelJochem opened this issue Dec 2, 2022 · 7 comments
Closed

Allow translating the module #203

GravendeelJochem opened this issue Dec 2, 2022 · 7 comments
Assignees
Labels
feature New feature or request next major This is present in the next major version of the module

Comments

@GravendeelJochem
Copy link

What problem does this feature solve?

The use for Dutch users

What should the solution look like?

Just a translation of the MyParcel plugin

Relevant log output

No response

Additional context

No response

@GravendeelJochem GravendeelJochem added the feature New feature or request label Dec 2, 2022
@mariuszsienkiewicz
Copy link
Contributor

mariuszsienkiewicz commented Apr 21, 2023

Hey! I am bumping this issue, for our client it's important too, we should be able to translate the module for each language turned on for the shop. Right now we can just override text but it's not a good way of handling this.

The second thing is that not all fields even now are available to override, for example, there is this constant:

public const CONFIGURATION_PICK_UP_FROM = 'MYPARCELBE_PICK_UP_FROM_TITLE';

But it's not used in the getConfig method nor in this method:

protected function getDeliveryOptionsStrings(): array
{
$getConfigurationString = static function (string $settings) {
return Configuration::get($settings) ?: null;
};
return [
'addressNotFound' => $getConfigurationString(CheckoutForm::CONFIGURATION_ADDRESS_NOT_FOUND),
'cc' => $getConfigurationString(CheckoutForm::CONFIGURATION_CC),
'city' => $getConfigurationString(CheckoutForm::CONFIGURATION_CITY),
'closed' => $getConfigurationString(CheckoutForm::CONFIGURATION_CLOSED),
'deliveryEveningTitle' => $getConfigurationString(CheckoutForm::CONFIGURATION_DELIVERY_EVENING_TITLE),
'deliveryMorningTitle' => $getConfigurationString(CheckoutForm::CONFIGURATION_DELIVERY_MORNING_TITLE),
'deliveryStandardTitle' => $getConfigurationString(CheckoutForm::CONFIGURATION_DELIVERY_STANDARD_TITLE),
'deliveryTitle' => $getConfigurationString(CheckoutForm::CONFIGURATION_DELIVERY_TITLE),
'discount' => $getConfigurationString(CheckoutForm::CONFIGURATION_DISCOUNT),
'free' => $getConfigurationString(CheckoutForm::CONFIGURATION_FREE),
'from' => $getConfigurationString(CheckoutForm::CONFIGURATION_FROM),
'houseNumber' => $getConfigurationString(CheckoutForm::CONFIGURATION_HOUSE_NUMBER),
'loadMore' => $getConfigurationString(CheckoutForm::CONFIGURATION_LOAD_MORE),
'onlyRecipientTitle' => $getConfigurationString(CheckoutForm::CONFIGURATION_ONLY_RECIPIENT_TITLE),
'openingHours' => $getConfigurationString(CheckoutForm::CONFIGURATION_OPENING_HOURS),
'pickUpFrom' => $getConfigurationString(CheckoutForm::CONFIGURATION_PICK_UP_FROM),
'pickupLocationsListButton' => $getConfigurationString(CheckoutForm::CONFIGURATION_PICKUP_LIST_TITLE),
'pickupLocationsMapButton' => $getConfigurationString(CheckoutForm::CONFIGURATION_PICKUP_MAP_TITLE),
'pickupTitle' => $getConfigurationString(CheckoutForm::CONFIGURATION_PICKUP_TITLE),
'postcode' => $getConfigurationString(CheckoutForm::CONFIGURATION_POSTCODE),
'retry' => $getConfigurationString(CheckoutForm::CONFIGURATION_RETRY),
'saturdayDeliveryTitle' => $getConfigurationString(CheckoutForm::CONFIGURATION_SATURDAY_DELIVERY_TITLE),
'signatureTitle' => $getConfigurationString(CheckoutForm::CONFIGURATION_SIGNATURE_TITLE),
'wrongNumberPostalCode' => $getConfigurationString(
CheckoutForm::CONFIGURATION_WRONG_NUMBER_POSTAL_CODE
),
'wrongPostalCodeCity' => $getConfigurationString(CheckoutForm::CONFIGURATION_WRONG_POSTAL_CODE_CITY),
];
}

Another example, the "options" text that's visible in the selected pickup view.

I could create a PR for this but I'm not sure if I will have time to do so. @EdieLemoine sorry for pinging but is there any real difference between myparcelbe and myparcelnl release/codebase? If I had the time, I could take care of it, but I'm not sure if the BE client version has the same language options as the NL version.

@EdieLemoine
Copy link
Contributor

Hi @mariuszsienkiewicz, sorry for the delayed reply.

We're currently in the process of rewriting the entire plugin to basically solve all open issues and support PS 8 and PHP 8. Therefore, we're probably not going to fix this in the current version, so if you want to do it, you're very welcome to.

MyParcel BE and NL are the same codebase (this repository), so you would only need to make a change once. Thanks in advance if you decide to open a PR! 😄

@mariuszsienkiewicz
Copy link
Contributor

mariuszsienkiewicz commented Sep 12, 2023

@EdieLemoine Unfortunately I had no time to do so but if I see it correctly in the dev branch it's still not done so maybe I will do that eventually.

By the way, are you working on making the fields translatable for each language that is enabled in each store? The fact It's not working like that is a huge pain right now.

@EdieLemoine
Copy link
Contributor

@mariuszsienkiewicz that's correct, we're not adding any features to the current version.

In the new version these fields are not configurable and will be automatically translated into the current language. What language(s) do you need? We currently only have Dutch, English and French, but we now have a system where it's super easy to translate everything into any language.

@mariuszsienkiewicz
Copy link
Contributor

Oh, that's even better then! :) When it comes to languages, I'm very happy that Dutch, English, and French will already be supported because we need those languages, but we will also need Polish and German, and we anticipate needing more languages in the future as well. Will the system you mentioned be publicly available? Like Crowdin or something?

@EdieLemoine
Copy link
Contributor

@mariuszsienkiewicz not yet, we currently have a Google Sheet only we can edit that's imported whenever the module is built. It's free and pretty convenient (for us), but definitely not ideal for collaboration.

After the big release stuff is out of the way we will look into better ways to manage this and allow other people to contribute. If you're willing to, you can copy the sheet, translate it and send it to me.

@EdieLemoine EdieLemoine added the next major This is present in the next major version of the module label Oct 24, 2023
@EdieLemoine EdieLemoine self-assigned this Oct 24, 2023
@EdieLemoine EdieLemoine changed the title Translation MyParcelNL plugin Allow translating the module Nov 30, 2023
@EdieLemoine
Copy link
Contributor

Possible in v4.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request next major This is present in the next major version of the module
Development

No branches or pull requests

3 participants