internationalization

'Un'-externalize strings from Eclipse or Intellij

徘徊边缘 提交于 2019-12-22 08:23:13
问题 I have a bunch of strings in a properties file which i want to 'un-externalize', ie inline into my code. I see that both Eclipse and Intellij have great support to 'externalize' strings from within code, however do any of them support inlining strings from a properties file back into code? For example if I have code like - My.java System.out.println(myResourceBundle.getString("key")); My.properties key=a whole bunch of text I want my java code to be replaced as - My.java System.out.println("a

Django Translation not working even with LOCALE_PATHS

有些话、适合烂在心里 提交于 2019-12-22 07:59:13
问题 So I'm using django 1.8 to create a new web site that has to be translated into portuguese. So to use django's own tools I added to my middlewares: 'django.middleware.locale.LocaleMiddleware', I also added to my context_processors: 'django.template.context_processors.i18n', and the i configure my language settings: USE_I18N = True gettext = lambda s: s LANGUAGE_CODE = 'en' LOCALE_PATHS = ( os.path.join(BASE_DIR, 'locale'), ) print LOCALE_PATHS LANGUAGES = ( ('pt-br', gettext('Portuguese')), (

i18next Displayed key instead of value

感情迁移 提交于 2019-12-22 07:59:12
问题 I have translation.json file in /locales/en/ { "app": { "name": "Example App" } } In html , I have: <a href="/" data-i18n="app.name"> In js : $(document).ready(function() { var language_complete = navigator.language.split("-"); var language = (language_complete[0]); console.log('language', language); $.i18n.init({ lng: language, fallbackLng: false, debug: false }, function() { $('a').i18n(); }); }); It displayed app.name instead of Example App . What i missed in my code? Thanks 回答1: You have

i18next Displayed key instead of value

泪湿孤枕 提交于 2019-12-22 07:59:11
问题 I have translation.json file in /locales/en/ { "app": { "name": "Example App" } } In html , I have: <a href="/" data-i18n="app.name"> In js : $(document).ready(function() { var language_complete = navigator.language.split("-"); var language = (language_complete[0]); console.log('language', language); $.i18n.init({ lng: language, fallbackLng: false, debug: false }, function() { $('a').i18n(); }); }); It displayed app.name instead of Example App . What i missed in my code? Thanks 回答1: You have

Handling international dates in python

我只是一个虾纸丫 提交于 2019-12-22 07:12:03
问题 I have a date that is either formatted in German for e.g, 2. Okt. 2009 and also perhaps as 2. Oct. 2009 How do I parse this into an ISO datetime (or python datetime )? Solved by using this snippet: for l in locale.locale_alias: worked = False try: locale.setlocale(locale.LC_TIME, l) worked = True except: worked = False if worked: print l And then plugging in the appropriate for the parameter l in setlocale. Can parse using import datetime print datetime.datetime.strptime("09. Okt. 2009", "%d.

Module Localization in DNN

落花浮王杯 提交于 2019-12-22 07:08:57
问题 I don't know much about the localization process in DNN. The question is that how can you localize a new module? Is it possible to include localization files with every module separately? What solutions can you come up with? 回答1: Localization of a module is pretty easy thanks to DotNetNuke. Wherever your .ascx (View) file is, the App_LocalResources folder should always accompany it, on the same level. There should also be a corresponding .ascx.resx file in that folder. view.ascx App

Java Swing - switch locale dynamically at runtime

瘦欲@ 提交于 2019-12-22 05:55:11
问题 I understand how to internationalize a java program, but I have a problem. Language in my program can be switched anytime, but my program can exist in many states, which means that it may or may not have several JLabels, JPanels, JFrames, etc, open. Is there a class or a method which will update the current GUI to the switched language, or does it have to be done manually? If nothing else works, I'll just require user to restart the program to switch the language, but runtime change would be

Dynamic names in Spring internationalization

一世执手 提交于 2019-12-22 05:54:40
问题 I have in the properties file several properties to be translated into different laguages: list.var1=XXX list.var2=XXX list.var3=XXX They are values of a list so in the JSP I want to get the translated value. So I have a property for example called myVar whose values can be {var1, var2, var3} and I want to get the message "list.${myVar}". The problem is that in fmt:message tag, key attribute doesn't accept expressions. <%@ taglib prefix="fmt" uri="java.sun.com/jstl/fmt" %> <fmt:message key=

PHP: does gettext require LC_MESSAGES dirs?

浪尽此生 提交于 2019-12-22 05:54:36
问题 To translate my PHP app I use compiled in gettext module. Here is a directory tree of translations made according to docs: locale/ cs_CZ/ LC_MESSAGES/ messages.po messages.mo de_DE/ LC_MESSAGES/ messages.po messages.mo fr_FR/ LC_MESSAGES/ messages.po messages.mo Question : is it possible to get rid of LC_MESSAGES catalog? Will PHP be able to find translations if I use this structure? locale/ cs_CZ/ messages.po messages.mo de_DE/ messages.po messages.mo fr_FR/ messages.po messages.mo My PHP

Rails I18n: Better way of interpolating links?

戏子无情 提交于 2019-12-22 05:52:28
问题 Is there a cleaner, content_tag-ish way of doing this? (I don't want HTML in my YML) en.yml: expert_security_advice: "Go <a href='{{url}}'>here</a> for expert security advice." layout.html.erb: <%= t(:expert_security_advice, :url => "http://www.getsafeonline.org") %> 回答1: The best I could come up with: en.yml: expert_security_advice: "Go *[here] for expert security advice." layout.html.erb: <%= translate_with_link(:expert_security_advice, "http://www.getsafeonline.org") %> application_helper