1

I have some questions about localization for plugins and components. I've searched around on the Joomla site, and didn't see an answer. I thought I'd try to avoid an archeological expedition through the source to find my answer :)

Does Joomla recognize language-only named variant files? If I create a translation file named de.somepackage.ini, will it get picked up by sites running de-DE, de-CH, de-AT?

If a country-specific variant file is not found does it fall back to the nearest match? For example, if I create translation named de_DE.somepackage.ini, will it get picked up by sites running de-CH, or de-AT?

Is there a fallback mechanism? In Java, I might have a captions.properties file, a captions_de.properties, and a captions_de_CH.properties file. When I ask for captions for de-CH, it it reads each dictionary from least specific to most specific sequentially, and overwrites any keys with the more specific version. Is there a similar mechanism at work in Joomla?

2

Joomla does not support country-specific variant files.

Even with British-English and American English, there are different files:

  • en-GB
  • en-US

They way Joomla works with it's language strings is, each language should have it's own language file, however as of Joomla 3.2, the en-GB file is loaded first. This ensures any missing constants have a fallback, rather than displaying the constant itself.

So my suggestion would be, to always ensure your en-GB language file is the primary one and always the first to be kept up to date.

  • There seems to be a lot of confusion in the Joomla world about what a language is. EN (English) is a language. GB is a country(United Kingdom). EN-GB is the localized version of English as spoken (or written) in that specific country. For example, in English, the word "Color" is pronounced more or less the same in the US and UK, but in the US it's spelled "Color" while in the UK, it's spelled "Colour". Another example of a difference between EN-US and EN-GB would be the starting day of the week (UK=Monday, US=Sunday), or date formatting (UK=DD/MM/YYYY, US=MM/DD/YYYY"). – George Sexton Mar 28 '16 at 20:55
  • 4
    No confusion at all. The language files are named based on the 2 character code (en, de, es, nl, etc..) for a country, and if there are 2 countries that speak the same language but use a different dialect, then different language files are used, like they are for British English and American English – Lodder Mar 28 '16 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.