How do I create a custom locale in Magento? - magento

The locale I need is not included in the standard Magento language extensions, so I need to create my own.
It will be es-us - Spanish language for the US.
I found this article: http://kb.magenting.com/content/14/50/en/translate-magento-interface-magento-localization-tips.html
It says:
"If there are no localization package for your locale you can create it by simply copying localization directory from English or any other translation."
Can someone walk me through how I get from that quote to having Spanish (USA) in the locale drop-down?
Thank you so much for your help!

I came upon this answer whilst investigating Mage_Core_Model_Locale_Config and I was able to come up with a solution that didn't require any code changes at all.
Mage_Core_Model_Locale_Config does indeed contain a hardcoded list of locales, but the getAllowedLocales() method combines this with the output of
Mage::getConfig()->getNode(Mage_Core_Model_Locale::XML_PATH_ALLOW_CODES);
in 1.4.2 the value of Mage_Core_Model_Locale::XML_PATH_ALLOW_CODES is
'global/locale/allow/codes'
So all you need to do is add the following xml to your app/etc/local.xml within your 'global' tags:
<locale>
<allow>
<codes>
<en_IE/>
</codes>
</allow>
</locale>
And the English(Ireland) locale will appear in your locale dropdown. The only limitation is that the locale code must be one of the ones defined in the Zend Framework documentation here:
http://framework.zend.com/manual/1.12/en/zend.locale.appendix.html
'es_US' is one of these supported codes. I hope that helps someone.
_Pez

Unfortunately, it looks as if the locale names are hardcoded in Mage_Core_Model_Locale_Config. Not only that, but language codes are installed in the database during install.
What I would recommend doing instead of rewriting that class to define your own custom language is to "piggyback" on another locale and use their code for your custom language pack. For example, in app/locale, you could place the folder gl_ES, copy over a Spanish language pack, and make the modifications you need for that language. Then for your store's locale in the dropdown (System > Configuration > General > Locale) you can choose Galician (Galician)
The custom solution that you're requesting I think would involve rewriting Mage_Core_Model_Locale_Config to add your new locale to the $_allowedLocales variable. I thought you may need to add the language to the core_language table but it looks as if that table's been deprecated.

Related

New Language Files

I am user of Joomla 2.5 cms and I try to built a double-language site.
Yesterday I installed this one module to my site
http://extensions.joomla.org/extensions/access-a-security/site-access/authentication-management/6660
but this don't support 2 languages, only one.
The help I need is some information on how I can add new files for this module with new labels of course at my excisting language packages.
if it doesn't support 2 languages, you have some problems
anyway you can ask your developer to help you.
or you can check the source and change the needed words to your desire language, then you can change the module name and install it separately
it is important to see if you have the right to change that extension.
and you can write your own of course :)

Maintaining translations for a Chrome extension

I'm thinking about using the internationalization support for Chrome extensions as described here.
The suggested way to make translations is to first create the English messages.json file, then copy it over and translate it into the given language.
My problem is that this works all right for the initial translation, but when there are already some translations and some changes happen in the extension I don't see an easy way to update the translations.
I guess I would need tools for these tasks:
detect new untranslated strings
detect strings changed in English that might need revision in other languages too
detect strings not used anymore
I guess by keeping around the original English messages.json file and using diff tools I could do this by hand, but I was wondering if there are any tools that can help with this.
You can try https://webtranslateit.com/.
We are using it.

Set Falang default language for joomla

I have my site in English & Spanish. I am using Falang Extension in Joomla and need to make Spanish language default. So that when a user visit the site he/she will see the Spanish language.
Is there anything I can do to make this possible?
You can install additional languages and choose your default from the Joomla Administrators Language Manager. Details at the Extensions Help. If your language isn't available from joomla.org directly, or you need additional language support, check the JED Language Support.
The problem may be due to Language Filter plugin configuration.
You have to open:
Extensions -> Plugin Manager -> System - Language Filter
And set:
Language Selection for new Visitors: Site Language
Hope this helps

Inno Setup message list somewhere?

Is there an official list of Inno Setup messages like "WinVersionTooLowError" somewhere? I need to change the "This will install AppName on your computer" but don't know how. Thanks!
The default language file should have a complete list, you can view the online CVS version here.
The translation download page contains this note:
Starting with version 5.1.0, the Inno Setup compiler will accept a
translation even if it's missing messages (it will use the default
English messages to replace them) or contains unknown messages.
so you should be able to create a custom English language file that only changes a couple of strings if that is what you want, but it is also possible to override the strings without using language files.
You might also want to take a look at Inno Setup Easy Translator

How to setup CodeIgniter for a truly multi language website?

I need to setup CodeIgniter to be a truly multi language website. I've searched but I can't find a solution.
I've tested this approach but it is not working. (http://codeigniter.com/wiki/Category%3AInternationalization%3A%3AInternationalization_Views_i18n/)
Can someone give me a clue about what setup to use to get a truly multi language environment in CodeIgniter?
Best Regards,
https://github.com/EllisLab/CodeIgniter/wiki/CodeIgniter-2.1-internationalization-i18n
If you implement this, you URLs will contain the language code. You can save your language parts in the language directory. With the function lang();
Loading language files and handling them is explained here:
https://www.codeigniter.com/user_guide/libraries/language.html
The helper:
https://www.codeigniter.com/user_guide/helpers/language_helper.html
Easiest way is have to some global language files which you auto load. I suggest creating a language file for every controller. So you only load the part you need instead of loading all language files.
From what I have learned. Building your own libraries and modules to handle them is a key. I haven't had much success with the native support as its a bit tricky sometimes. But basics to it is you have your default site load with the options to choose a language of your choice where within the site you echo out variables instead of static text. Those variables are then stored in what you can call a language pack. Where you have the same variables per language pack but the translated version per pack language. With code igniter it might be a bit more difficult then just appending to your url an identify for any given other language ie: mydomain.com/en/ mydomain.com/it/ mydomain.com/fr/ and then having a language load based off the URL like that however you can use CI's built in session support to store which language should be displayed. And based off of that display the choosen language I know thats not a super dead on answer how to do it, but this is how I would handle it should I ever get a project where I want multi language support.

Resources