internationalization

Programmatic language localisation without restart

流过昼夜 提交于 2019-12-18 03:03:19
问题 I want to create an iPhone application with English and Arabic language. I checked the Internationalization document for language switcher, however to take that into effect I have to manually go and change the iPhone setting. I don't want to do that. So what I am planning is on home screen I will have two button as English and Arabic. If user click Arabic, I will have arabic text and if user select English, app will be in english. Any idea/ suggestion how to get this done? Note: I don't want

Why do people use plain english as translation placeholders?

戏子无情 提交于 2019-12-18 01:27:54
问题 This may be a stupid question, but here goes. I've seen several projects using some translation library (e.g. gettext) working with plain english placeholders. So for example: _("Please enter your name"); instead of abstract placeholders (which has always been my instinctive preference) _("error_please_enter_name"); I have seen various recommendations on SO to work with the former method, but I don't understand why. What I don't get is what do you do if you need to change the english wording

i18n Pluralization

六眼飞鱼酱① 提交于 2019-12-17 22:59:37
问题 I want to be able to translate pluralized strings in i18n in rails. A string can be : You have 2 kids or You have 1 kid I know that I can use pluralize helper method, but I want to embed this in i18n translations so that I don't have to mess up with my views at any point in the future. I read that :count is somehow used in translations for plural, but I can't find any real resources on how it gets implemented. Notice that I know that I can pass a variable in a translation string. I also tried

How can I add internationalization to my Perl script?

耗尽温柔 提交于 2019-12-17 22:55:05
问题 I'm looking at introducing multi-lingual support to a mature CGI application written in Perl. I had originally considered rolling my own solution using a Perl hash (stored on disk) for translation files but then I came across a CPAN module which appears to do just what I want (i18n). Does anyone have any experience with internationalization (specifically the i18n CPAN module) in Perl? Is the i18n module the preferred method for multi-lingual support or should I reconsider a custom solution?

Localized country names

試著忘記壹切 提交于 2019-12-17 22:53:54
问题 Where can I get the country names in all languages? I need these to localize an application. 回答1: The proper location to get this information from is CLDR - Unicode Common Locale Data Repository. There you can find an updated list of countries ( core/common/main ), the data is available in numerous formats. 回答2: I recommend this site: https://github.com/umpirsky/country-list List of all countries with names and ISO 3166-1 codes in all languages and data formats. 回答3: There's probably an ISO

django i18n_patterns hide default lang_code from url

时光毁灭记忆、已成空白 提交于 2019-12-17 22:25:58
问题 I'm using the i18n_patterns to add a prefix of current lang_code to my url. urlpatterns += i18n_patterns('', url(r'^', include('blaszczakphoto2.gallery.urls')), ) It allowes me to get urls like /en/about-us/ , /pl/about-us/ etc.. My default language is pl LANGUAGE_CODE = 'pl' I want url like /about-us/ for clients viewing my site in polish lenguage. Is there any way to hide lang_code prefix from url for default lang_code? 回答1: Here is a very simple package: django-solid-i18n-urls After setup,

How to create an internationalized Google App Engine application

你离开我真会死。 提交于 2019-12-17 22:25:00
问题 I would like to provide my Python GAE website in the user's own language, using only the tools available directly in App Engine. For that, I would like to use GNU gettext files (.po and .mo files). Has someone successfully combined Python Google App Engine and gettext files? If so, could you please provide the steps you used? I had started a discussion in GAE's Google group, but haven't been able to extract from it how I'd like to do it: I don't want to add external dependencies, like Babel

Detect User's Preferred Language and Google Translate Automatically

寵の児 提交于 2019-12-17 22:24:49
问题 I use this script in my site for translation <div id="google_translate_element" align="center"></div> <script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement({ pageLanguage: 'auto', autoDisplay: false, layout: google.translate.TranslateElement.InlineLayout.SIMPLE }, 'google_translate_element'); } </script> <script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> It is working just fine :) But is

Django internationalization language codes [closed]

主宰稳场 提交于 2019-12-17 22:22:25
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Where can I find list of languages and language_code like this. (Swedish,sv) (English,en) 回答1: Wiki: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes 回答2: If you want something you can use from within django, try: from django.conf import settings this will be in the format above, making it perfect for

django - how to make translation work?

主宰稳场 提交于 2019-12-17 21:55:54
问题 I'm trying to render a template in a different language using i18n. I did everything I could read about, from setting the language code, creating and compiling translation files, including the translation tags in the template and all that, and my template still renders in English, even through the {{ LANGUAGE_CODE }} variable points to the correct (and different) code I intended to render. What am I missing? template: {% extends "base.html" %} {% load i18n %} {% get_current_language as