internationalization

Can I automatically update msgids in gettext's .po files for trivial text changes?

一世执手 提交于 2019-12-03 14:42:33
With gettext, the original (usually English) text of messages serves as the message key ("msgid") for the translations. This means that every time the original text changes, the msgid must be updated in all the .po files. For real changes of the text, this is obviously unavoidable, as the translator must update the translation. However, if the change of the original does not change its meaning, re-translation is superflous (e.g. change in punctation, whitespace changes, or correction of a spelling mistake). Is there a way to update the .po files automatically in that case? I tried to use

How to expire fragment cache when locale changes?

戏子无情 提交于 2019-12-03 13:53:18
I'm trying to use fragment cache to cache the footer and navigation bar on a Ruby on Rails Site that uses I18n. The problem is, changing the language then shows you the footer and navigation bar in the wrong language. How do you go about expiring fragment cache when locale changes? Rather than expiring the fragment cache, you should make the locale part of the cache key, i.e. something like cache :locale => I18n.locale, ... do ... end This way different users can see different language versions of the footer/navigation bar but all will see cached versions. When caching a fragment in Rails 3,

How can using gettext help me here?

梦想与她 提交于 2019-12-03 13:41:21
I am trying to set up a way to allow members to translate strings into other languages. You can see an example here: TRANSLATIONS TEST Someone recommended that I use php's native gettext() function for this, instead of what I am already using to load the language files, which is this: function loadLanguageFile($language, $file) { $temp = array(); $data = file_get_contents('./'.$language.'/'.$file.'.'.$language.'.php'); $codes = array ( '/(\'\s*\.\s*\$)(.+?)(\s*\.\s*\')/', '/(=\s*\$)(.+?)(\s*\.\s*\')/', '/(\'\s*\.\s*\$)(.+?)(;)/', '/(\[\')(.+?)(\'\])/', '/<\?php/s', '/\?>/s', '/<\?/s' ); $html

Rails 3 I18n for database tables

不问归期 提交于 2019-12-03 13:38:15
问题 I'm looking for some tips and advice for the best practices for using internationalization. I've search around, but I haven't really been satisfied with what I read. Most of the articles I've read focus on using yml files for I18n which will not work in my situation. I currently have several database tables with text in English. Some of these tables have text fields that are a few sentences long and some are 6+ paragraphs of text. I would like to also have these fields in Spanish. The

sencha touch i18n basics

折月煮酒 提交于 2019-12-03 13:37:39
How is i18n handled within Sencha touch? (I am talking of localization support for strings, but also of localized components) A more specific question: I have a form that contains a date picker, how do I make sure that the date will be displayed and picked in european format when I access the application using a french android phone? Cheers There isn't an official API for i18n in SenchaTouch, yet. Although in Ext 4 there are localization files for all components in the /locale folder. There is an old tutorial that indicates a way, by dynamically in setting the src attribute of a script tag

Why would the makemessages function for Django language localization ignore html files?

跟風遠走 提交于 2019-12-03 13:16:44
I am trying to run the Django language localization on a project, but makemessages always ignores the html templates in my templates folder. I'm running python manage.py makemessages -a from the project root, and all of the strings that are marked for translation inside .py files anywhere in the project are successfully added to the .po file. Any of the strings in the html templates, i.e., {{ trans "String_to_translate" }} are ignored and not added to the .po file even though the necessary module is loaded at the top of the template, {% load i18n %} . To test the possibility that the whole

Setting RequireJS i18n locale dynamically

微笑、不失礼 提交于 2019-12-03 13:10:24
问题 I am using the RequireJS i18n plugin to load translations into my application. I'm struggling with the concept of runtime determination of a user's preferred language . The plugin works well if you're using navigator.language to determine the user's preferred language, but in my app, the user's language is held in a database on the server. So I need to set the locale at runtime: require.config({ config: { i18n: { locale: userLocale } } }); So what I need is a clever way of setting userLocale

IE8 font-size toggles on :hover - Japanese lang only

怎甘沉沦 提交于 2019-12-03 12:57:08
I have a page that is multi lingual and I have an issue with the Japanese version only. For some reason in IE8, when I hover over an element, a sibling's font-size will increase/decrease. Even stranger, is that this doesn't happen on every hover, sometimes I cannot reproduce straight away, I need to keep hovering over different elements in the same area of the page. Eventually this bug will rear its ugly head. This bug only occurs on the Japanese page, all other languages seem to be fine. This could be happening on other versions of Internet explorer, I haven't tested on all. To clarify, I

Django1.4: Generic way to set language links in template to work with i18n_patterns?

寵の児 提交于 2019-12-03 12:51:46
I started to play with new i18n_patterns in Django 1.4. Basically, i want to have language links for each of my supported languages on all of my templates headers. I have implemented my header as a separate template that is being included in other templates. Is there a way to keep my header generic and solve this without passing the current view name or current url in template context? I guess it comes to a question how do i retrieve the current view or url from inside the template in a generic way. BTW, i discovered that my previous approach with set_lang view to change the active language

Delphi and i18n

你说的曾经没有我的故事 提交于 2019-12-03 12:46:40
Does Delphi support internationalization in any way? I've seen that I can add different languages for a project, but that seems to create multiple instances of the dfm files. Am I right that the language therefore cannot be changed at runtime? How do you handle internationalization (if you do)? Are there any best-practices? I have once experimented with runtime change of languages. It worked great, but I needed to write lots of code myself (and circumvent the dfm files). The problem is, it is a lot of hassle and you almost never need this. The better option (in my opinion) is to create a base