SimplCommerce icon indicating copy to clipboard operation
SimplCommerce copied to clipboard

Localization Translations Suggestion

Open hishamco opened this issue 5 years ago • 17 comments

I was talking with @fhebel on Gitter to make the translations better in SimplCommerce, so here are few ideas I'd like to share and your feedback are welcome

The problem are:

  • we realize that the translations isn't synchronous with the database entries

  • Many PRs are made to fix a little translations issues or missing once

with that I'm suggesting the following:

  1. Create a .NET CLI Core tool to extract the localization strings or

  2. Create another repo named SimplCommerce.Transaltions that manage the translation part or may be

  3. Create a translation service transalte.simplcommerce.com

The 2 & 3 point needs to consult @thiennn because he has the ownership for the repo

IMHO the tool is very useful to extract the localization strings, then either we can use it from an online service or generate SQL scripts that we need to run later

/cc @fhebel @thiennn

hishamco avatar May 07 '20 19:05 hishamco

  1. It's great, but I am not sure we can extract the localization string via CLI 2 & 3 Could you please explain more. Or some mock-up would be really helpful

Thanks

thiennn avatar May 08 '20 17:05 thiennn

  1. We need to build a tool for doing this

  2. Creating another repo that separate the translations from the actual source, then we can update SQL scripts periodically or find some way for doing auto commit via bot into the actual SimplCommerce repo

  3. Create a web-based service that allow the contributors to edit the translations for SimplCommerce

FYI both options 2 or 3 may need that tool to know the default localization strings (es-US)

hishamco avatar May 08 '20 18:05 hishamco

I can work on the tool, but regarding the translations repo or the service I need your opinion, because it requires to create another repo named SimplCommerce.Transaltions or new sub domain http://www.translations.simplcommerce.com

hishamco avatar May 08 '20 18:05 hishamco

We do have a UI for admin to update translation https://demo.simplcommerce.com/admin#!/localization

thiennn avatar May 08 '20 22:05 thiennn

I knew, but this should will let everyone to translate the localization string over again and again .. the proper solution is to provide a service or a repo to let the users fetch the supported translations, the admin UI may useful for some cases such as non support translation other than that me as a user I expect the translation is already there, especially if the translation is supported

hishamco avatar May 09 '20 00:05 hishamco

I can imagine a switch in SimplCommerce whether to take the translations from that new service or in the old way. In addition it would be nice if it was possible to selectively copy translations from that service to the own database (that resolves the current issue that there are several scripts for translations in different db flavors, which are probably out of sync) ...

fhebel avatar May 10 '20 12:05 fhebel

As I mentioned before, creating another repo or a service will resolve the issue that @fhebel mentioned above

hishamco avatar May 10 '20 12:05 hishamco

Repo created https://github.com/simplcommerce/SimplCommerce.Transaltions

thiennn avatar May 10 '20 15:05 thiennn

Thanks @thiennn. May I ask you to correct the spelling though (Translations instead of Transaltions)?

fhebel avatar May 10 '20 15:05 fhebel

@thiennn could you please give access to that repo, so I can merge PRs if it's possible, my plan is

  1. Creating a .NET Core CLI tool

  2. Start pushing a SQL script into the Translations repo

hishamco avatar May 10 '20 19:05 hishamco

@hishamco maintainer access is given

thiennn avatar May 10 '20 23:05 thiennn

@thiennn I create a dev branch could you please set it as default, the master branch will be for stable releases that align with SimplCommerce repo

hishamco avatar May 11 '20 01:05 hishamco

Just a quick question to refresh my memory ;) Is the localization SQL script executed manually or not?

hishamco avatar May 11 '20 01:05 hishamco

I will start to create the new tool with the following plan:

Step 1: Scan the views of the SimplCommerce.WebHost

Step 2: Scan the code of the SimplCommerce.WebHost

Step 3: Scan the available modules

Assumptions:

  • We should unify the naming for the HtmlLocalizer, StringLocalizer and ViewsLocalizer I will go thought the entire source and make sure that everything is consistent

Result:

  • Generate en-US.sql based on the scanned localized strings

  • Create a SQL script for all the supported cultures, we should decide which should be supported for the long term because this needs a community involvement

hishamco avatar May 11 '20 02:05 hishamco

Woohoo seems the extractor tool is promising

SimplCommerceLocalizationStringsExtractor

hishamco avatar May 11 '20 14:05 hishamco

I'd like to inform you that the tool discover some localization string issues, and other missing onces

hishamco avatar May 12 '20 21:05 hishamco

@thiennn @fhebel you could have a try the tool that hosted in https://github.com/hishamco/SqlExtractor

Still looking for better name for it ;) your suggestion

hishamco avatar May 12 '20 21:05 hishamco