Package internationalization not working
Permalink
I am internationalizing a site of ours and have set it up successfully to find the translations in my /languages/xx_XX/LC_MESSAGES/messages.mo file but can't seem to get the translations in my /packages/mypackage/languages/xx_XX/LC_MESSAGES/messages.mo file to be used. I've tried removing the root /languages directory in case that would override any package-specific translations with no luck. If I point the /languages directory at my /packages/mypackage/languages directory using a soft link it works so I know things are generally right, I just can't seem to make c5 use the translation for the package the way I understand it should. Any ideas what I could be doing wrong?
Thanks for the ideas. The messages.mo file is 18k and clearing caches doesn't help anything - I can turn on and off the translation by moving the languages directory between root and under /packages/<mypackage> so the file is good, it just seems to be ignored unless it's directly under /. I've tried creating the structure and files using both the Translations Manager add-on and Michele Locati's i18n.php utility (https://github.com/mlocati/concrete5-build) and both sets of files exhibit the same behavior.
It seems like there must be something wrong with my config or something, that c5 either needs to be told to look for the files within the packages or that I'm somehow telling it not to do so. All caching is turned off - Blocks, Overrides, and Full Page - I specifically checked for the Overrides Cache in case it had locked into using the root version but it was already turned off.
Thanks again - any other ideas? Anybody?
It seems like there must be something wrong with my config or something, that c5 either needs to be told to look for the files within the packages or that I'm somehow telling it not to do so. All caching is turned off - Blocks, Overrides, and Full Page - I specifically checked for the Overrides Cache in case it had locked into using the root version but it was already turned off.
Thanks again - any other ideas? Anybody?
Think I got it figured out! Looking in /concrete/core/libraries/localization.php, function setLocale, it only will set the locale if there is a directory for the passed-in $locale in either /languages or /concrete/languages. If neither of those exist, c5 (or Zend) will not look in the various package directories for translations.
As a test, I downloaded the language pack for the c5 core fromhttp://www.concrete5.org/developers/translate/... and unzipped it in / then my package translations were found!
As a test, I downloaded the language pack for the c5 core fromhttp://www.concrete5.org/developers/translate/... and unzipped it in / then my package translations were found!
It's quite an important thing to know!
I updated my "Translate your package" how-to (http://www.concrete5.org/documentation/how-tos/developers/translate... ) to state that.
I updated my "Translate your package" how-to (http://www.concrete5.org/documentation/how-tos/developers/translate... ) to state that.
Thanks Michele!
Faced the same or similar problem on 8.0.3 and found a different solution. See https://www.concrete5.org/developers/bugs/8-0-3/no-translated-messag...
I may have come across the same or maybe a new issue. I have C5-8.2.1.
I have a weird localization bahavior. I translated my package. When I add my package, the form to add my block is translated. But when the block is placed - nothing is translated. Also in the Dashboard, nothing on the Add Functionality is translated, but when I click to see details of the block - everything IS translated. How come?
I have a single language (not multilingual) site, the interface is set to the language
And it's not just my package. Any translated package does this.
More here:
https://github.com/concrete5-community-store/community_store/issues/...
https://www.concrete5.org/community/forums/internationalization/c5-8...
I have a weird localization bahavior. I translated my package. When I add my package, the form to add my block is translated. But when the block is placed - nothing is translated. Also in the Dashboard, nothing on the Add Functionality is translated, but when I click to see details of the block - everything IS translated. How come?
I have a single language (not multilingual) site, the interface is set to the language
And it's not just my package. Any translated package does this.
More here:
https://github.com/concrete5-community-store/community_store/issues/...
https://www.concrete5.org/community/forums/internationalization/c5-8...
[UPDATE] This is THE problem and C5 bug:
I always install C5 on all sites with the default English language. It's just easier for me. Then I change the language in Dashboard just before I release the site.
Now, I've just deleted my site from my PC, cleared the DB as well and reinstalled C5-8.2.1 from scratch BUT I selected Russian language from the very beginning... installed everything in Russian, installed my package - and here we go, the package is fully translated!!!
Yes, the Community Store is now fully translated too!
So, to reproduce the bug: install C5 in English, change site language, install a translated package.
I always install C5 on all sites with the default English language. It's just easier for me. Then I change the language in Dashboard just before I release the site.
Now, I've just deleted my site from my PC, cleared the DB as well and reinstalled C5-8.2.1 from scratch BUT I selected Russian language from the very beginning... installed everything in Russian, installed my package - and here we go, the package is fully translated!!!
Yes, the Community Store is now fully translated too!
So, to reproduce the bug: install C5 in English, change site language, install a translated package.
Also, check the size of the .mo file. Zend Locale checks the file size and skips it if it only contains 1 translation for example. How many KB is yours?