enkelmedia / TheDashboard

Magic dashboard for Umbraco
MIT License
39 stars 42 forks source link

Localize text #2

Closed bjarnef closed 7 years ago

bjarnef commented 9 years ago

Could we add localization for the text. At the moment we have to modify the core langauage files in /Umbraco/config/lang/ folder, but soon we can ship translations with the package (seems to be scheduled for v. 7.3.0 - http://issues.umbraco.org/issue/U4-5777)

I think Merchello actually have language files in their own folder and during install modify the core language files by adding these additional keys. https://github.com/Merchello/Merchello/tree/1.9.0/src/Merchello.Web.UI.Client/src/config/lang

https://github.com/Merchello/Merchello/blob/8a46baae4f86e80cc97e6a2a1d170e4a27a1d50e/src/Merchello.Web/PackageActions/AddLocalizationAreas.cs

enkelmedia commented 9 years ago

Hi! Sounds like a good idea! I have another solution for my Newsletter Studio package that I might be able to share in this project - but even better would be to wait for the official way to do it?

bjarnef commented 9 years ago

You can always update the views using localize element or attribute directive. Or localizationService from controller if it is needed. Maybe the packageaction could be used for versions prior Umbraco 7.3.0?

Warren added I to the Analytics package: https://github.com/warrenbuckley/Analytics/blob/develop/Analytics/InstallHelpers.cs

so maybe you could reuse some of the code for now? and when 7.3.0 is ready either use it as fallback or make a new release for 7.3+ and he existing package for v 7.1, 7.2.

btw, could you mark which versions the package works with / is tested with on Our? :+1:

enkelmedia commented 9 years ago

Hi! I don't think we should spend time on a solution that puts the translations in the /umbraco/-folder during install as this folder will be replaces during upgrades.

See what Warrens helper does: https://github.com/warrenbuckley/Analytics/blob/develop/Analytics/TranslationHelper.cs

So lets wait for what happens with the native translation support for packages - or if this takes to long - I'll probably use the solution I've included for Newsletter Studio =D

EDIT: About the versions - it will work for all 7+ versions of Umbraco. I'll add that =D

bjarnef commented 9 years ago

Yea, I know it inserts/modify the core language files - that's the only way I know to use translations with packages.

During upgrade you have to merged language files anyway if you are using packages like uCommerce, Tea Commerce, Merchello, SeoChecker etc.

I am not sure what the progress is for Umbraco 7.3.0 and when the final release for 7.3.0 is planned - it seems to have issues scheuled that still needs to be fixed http://issues.umbraco.org/issues?q=%237.3.0 ...

Anyway if pretty much same code could be used and the package action only is added for version prior 7.3.0 it might be worth to support Umbraco 7.1 and 7.2. Alternative just add docs for the keys that needs to be added to the language files.

enkelmedia commented 9 years ago

True - we support for other versions would be good =D I'll include my solution in the code base during the upcoming weeks.

bjarnef commented 9 years ago

@enkelmedia can you update the project compatible version, so the list here https://our.umbraco.org/projects/ doesn't display n/a? :)

enkelmedia commented 9 years ago

@bjarnef did that but probably a cache or we need more votes. https://our.umbraco.org/projects/backoffice-extensions/the-dashboard/

bjarnef commented 9 years ago

Yes, I saw that. Not sure why it isn't changes then. Could you check this issue?http://issues.umbraco.org/issueMobile/OUR-92

It shouldn't require votes to mark which versions of Umbraco the project is compatible with :)

bjarnef commented 9 years ago

@enkelmedia the issue about the compatible versions is fixed now! :)

bjarnef commented 9 years ago

It doesn't seem that the text has been localized? From the source here it still use hardcoded text :)

enkelmedia commented 9 years ago

Thats true, I haven't had the time to add it to this project - if you are willing to create a PR I'm happy to look at it.

bjarnef commented 9 years ago

Okay, but why not keep the issue open until it is fixed? :)

enkelmedia commented 7 years ago

Released with version 1.2!

enkelmedia commented 7 years ago

Thanks a lot for the help @bjarnef !