OrchardCore icon indicating copy to clipboard operation
OrchardCore copied to clipboard

Available to upload PO file

Open khoshroomahdi opened this issue 6 years ago • 11 comments

add an option to upload PO file in admin area. and it's better to change PO file in admin like Nopcommerce. localization in nopcommerce is very useful because use can translate easily every text that he/she wants.

khoshroomahdi avatar Jan 15 '19 20:01 khoshroomahdi

PO files are loaded on startup of the Localization module. So, you can, as of now, add/edit translations on runtime by enabling/disabling the Localization module to reload all it's translations. Though, you need to put your localization files under {yourproject}/App_Data/Localization/{some different paths as stated in documentation}.

I like the idea to be able to edit the PO files directly from the admin since it could also restart the localization module or the tenant every time we would save one of the PO file. Else, an other solution would be to keep it as it is right now but to have a button somewhere to reload the localization translations, but that would be equivalent as reloading the Localization module.

Skrypt avatar Jan 15 '19 22:01 Skrypt

So add restart button to admin.

khoshroomahdi avatar Jan 17 '19 11:01 khoshroomahdi

Everything is doable.

Options 1- Browse crowding for available translations, and download them automatically to /App_data/Localization/[culture] of the tenant, or the full site. 2- Allow for uploading "ANY" file anywhere in "App_data", but would require Site owner permission 3- Allow for editing any file from App_data directly from the admin 4- Be able to provide custom translations from the admin, and store them in the database. Could then be exported/imported with recipes, as PO files?

I prefer the 4th option. For flexibility and security. The other options are easily solved by copy pasting a file during deployment.

sebastienros avatar Jan 17 '19 20:01 sebastienros

4

pgy866 avatar Jan 20 '19 05:01 pgy866

4 For more information look at noncommerce

khoshroomahdi avatar Jan 20 '19 08:01 khoshroomahdi

The forth option we let us create another StringLocalizer to read the localization resources, while the intend is reading them from .po files

It will be better to use sort of Language Pack that contains the .po files - that's we already TRUST in crowding - to be installed

hishamco avatar Apr 11 '19 22:04 hishamco

Then we agree on the 4th option. It needs some UI to edit the "dynamic" entries, and also some recipe steps to import/export them. And change the po library to accept other sources than the file system.

sebastienros avatar Apr 18 '19 19:04 sebastienros

I'm still disagree for the above reasons that I mentioned before

hishamco avatar Apr 18 '19 23:04 hishamco

Then upload the file from crowdin in your app, and restart the tenant.

sebastienros avatar Apr 18 '19 23:04 sebastienros

If we provide a way to install a language packs either in setup or from admin, why we need to restart the tenant especially if the culture is already available in the supported list?!!

hishamco avatar Apr 18 '19 23:04 hishamco

I understand why you want to be able to download a set of po files dynamically from crowdin, the same way we can add support for new languages dynamically, but right now we only support the file system, so it needs to be deployed on all machines, not just the one that handled the request, and this is not trivial.

A solution is to store these entries in the db, which is common to all machines by definition, but then we lose some perf on startup. Which is why I suggest to only allow to add custom string in this database, and ways to import or export it, that will provide a solution to patch missing localizations, or work on them dynamically.

sebastienros avatar Apr 19 '19 00:04 sebastienros