FAQ Database Discussion Community


Word conjugation with Django i18n and gettext

django,internationalization,gettext
Currently, I have the following code in a template file in my Django project: {% blocktrans with type=content.get_type %}Edit this {{ type }}{% endblocktrans %} The {{ type }} is a string that can have values such as "lecture" and "exercise". Here is the output in the .po file: msgid...

switching between RTL and LTR in play framework

playframework,internationalization,playframework-2.3,scala-template
we are developing a web site that we need to support both LTR and RTL. we find that the best way is to change in CSSs(i.e. CSS for LTR and another to RTL). and that worked fine, the question is how to decide wether the language needs LTR or RTL....

How to remove languages in transifex?

user-interface,localization,internationalization,translation,transifex
I manage a project in transifex to localize an open source C++/Qt project. A lot of people contributed translations so far and I'm satisfied with the progress made. However, I fail to find out how to clean up unused, untranslated languages. Every now and then, people request rare languages and...

Internationalization in Java Error

java,eclipse,properties,internationalization,resourcebundle
I am learning Java, our teacher told us an internationalization example in netbeans, he created three properties file for different language ( in netbeans u can easily create properties file ), so i was trying this at home using eclipse, now i created 3 properties file exactly in the same...

Validation message not found

spring,validation,internationalization,spring-boot,thymeleaf
I'm trying to implement a custom error message for my bean validation. I've annotated my field firstName with the validation rule @Size( min = 2, max = 40, message = "errors.firstName.size" ). In my message.properties I added a message key errors.firstName.size=First Name must be between {min} and {max} chars. However,...

How to use Yii::$app->language

internationalization,yii2
I'm hard to know what is the ideal place to use the **\Yii::$app->language = 'pt';** I tried in main.php view, but only the menu got the translation. In the tutorial-i18N says: You may set the application language at runtime to the language that the user has chosen. This has to...

angularjs i18n routing with path params

javascript,angularjs,routes,internationalization,ngroute
In one application that I'm working with, the route system need to be integrated with i18n, like the example below: $routeProvider.when('/:i18n/section', ...); But I'm facing some issues due to, what I guess it is, the $digest cycle, which doesn't change the i18n param at the runtime. Other issue that I'm...

How Do I Use the route_translator gem and not require the Locale?

ruby-on-rails,localization,routes,internationalization,rails-i18n
I'm able to successfully use the route_translator gem when I require a locale. When I change between the two locales I have (en:fr) I have no problems clicking any of the links and displaying the correct views and link translations. Here is my config/routes.rb file where my routes work as...

grails message as argument of other message

grails,internationalization,taglib
I have this for example in my i18n messages_es.properties birds.label=Aves mammals.label=mamiferos reptiles.label=reptiles default.no.items.found=No se encontraron {0} And then I want to use the message, inside the template argument in my Grails .gsp Views: <g:message code="default.no.items.found" args="<g:message code='birds.label'/>"/> This of course doesn't work. But is there a way to make this...

Django Internationalization gives fuzzy with capital letters

django,internationalization,django-1.7,po
I am setting up internationalization for a Django project (1.7). I am successfully generating .po files, however, I have entries such as: #: my_app/templates/my_app/profile.html:155 #, fuzzy #| msgid "Court" msgid "court" msgstr "" From what I understand , fuzzy will cause the translation not to happen. I would like the...

Internationalisation-correct way to select network adapter to bind to

windows,internationalization,ndis
I have an application which needs to bind to a "Microsoft Loopback Adapter". I can enumerate all the network devices and perform a string match on the friendly name, but of course this will fail on international Windows variants. What is the correct way to identify the right network adapter?...

Rails I18n changes apostrophe to ASCII

ruby-on-rails,internationalization,responders
I'm using responders gem, and I want to show validation errors when form is not valid. In my controller I created the interpolation_action def interpolation_options { resource_errors: @project_user.errors.full_messages.join(', ') } end and my reponders translation file has a proper key: project_users: create: notice: "Member has been added" alert: "%{resource_errors}" It...

How do I internationalize instance variables in button_to methods in my views?

ruby-on-rails,internationalization
I have a number of view files that I am trying to internationalize. One of these files happens to have lines of code such as this one: = button_to t('.spam'), label_as_spammer_account_path(@topic.account), method: :post, data: { confirm: t('.spam_confirmation'), user: @topic.posts.first.account.name }, class: 'btn btn-mini btn-warning' The part that I am trying...

rails i18n passed params get lost

ruby-on-rails,ruby-on-rails-4,internationalization,rails-i18n
I started using i18n with my app, but all the pages that i access by passing a parameter with the link_to isn't working. so, let's say i'm currently on this page /ar/browse?type=art that i got to via clicking on this link_to <%= link_to "/ART/", browse_url(:type => "art")%> then i decided...

GWT i18n Message Properties does not Display special Character like ß

java,javascript,html,gwt,internationalization
I use GWT i18n Messages to translate messages: @DefaultLocale("en") public interface Messages extends com.google.gwt.i18n.client.Messages { @DefaultMessage("Size") String size(); } For German I have the Messages_de.properties file. size=Größe äüö ÄÖÜ In one of my UIBinder templates I use <ui:text with="{messages.size}"/> When the user's browser is deI get Grösse ÄÖÜ ÄÖÜinstead of...

Symfony - Getting a Supported Languages List

symfony2,internationalization
I've been searching around, but I've yet to find a built-in way to get a list of language your particular symfony app supports (i.e., a list of languages that have translation files in the project). Pretty much every code sample I've seen has just hardcoded an array of supported languages,...

Passing a hash to i18n translation

ruby-on-rails,ruby,internationalization,rails-i18n
I'm in the proccess of creating notification system. System should notify user about some changes in models, ie this is my .yml file ru: notifications: task: "New task named %{notifiable.task_name}" order: "New order with price %{notifiable.price}" You understand now that I have a associations User has_many Notification and Notification has_one(polymorphic)...

CakePhp i18n translation words order in .po files

php,cakephp,internationalization,cakephp-2.5
Currently in a view I have this: <span style="color: #2363a2;"><?php echo __('Accèdez à tous les %spronostics%s d\'%s', '<span style="font-weight: bold; text-transform: uppercase">', '</span>', AppController::getSiteName()); ?></span> In my .po file I have this: msgid "Accèdez à tous les %spronostics%s d'%s" msgstr "Reach all the %s %spicks%s" The translation I get (from...

Rails i18n linking issue?

ruby-on-rails,internationalization
So within config/locales/, a file en.yml exists containing, in part: en: company: street: 'x' with my view (initially an erb temp) I am calling <%= t(company.street) %> however I am receiving the following error: undefined local variable or method `company' for #<#<Class:0x007fbbf1544de0>:0x007fbbf121b448> Thoughts as to where I may be going...

Are there any unicode/wide chars that encode to multiple encoded characters

c,character-encoding,internationalization
Consider wctomb(), which takes a wide character and encodes to the currently selected character set. The glibc man page states that the output buffer should be MB_CUR_MAX, while the FreeBSD man page states the output buffer size should be MB_LEN_MAX. Which is correct here? Are there any example wide char/encoding...

Rails I18n not replacing variable

ruby-on-rails,internationalization,i18n-gem
I'm having trouble with some of my translations not having their variable replacements replaced with the text I supply and instead just outputting the translation literally. An example translation formats: view_all_other: "View all other %{format_title}" An example use (HAML) = link_to t('formats.view_all_other', format_title: @format.title.downcase), "/#{@format.to_param}/all" What gets output I've been...

How to log exception in InvariantCulture?

c#,asp.net-mvc-4,exception-handling,internationalization,error-logging
In my MVC solution I have two handlers for exception. First logs exceptions to Logs database: public sealed class LogErrorAttribute : Attribute, IExceptionFilter { public void OnException(ExceptionContext filterContext) { // some handling with filterContext.Exception } } Second shows exception to user: public sealed class AsyncAwareHandleErrorAttribute : HandleErrorAttribute { public override...

Drupal taxonomy terms language depending - why nodes in all languages are visible?

drupal-7,internationalization,drupal-taxonomy
What I want to acheive: I have multilingual site (i18n module). I have vocabulary named "brands" - terms of vocabulary don't need to be translated because they are the same in all languages. I've also nodes that I can assign to languages and "brands". In taxonomy - in multilingual options...

Codeigniter view in Wordpress

php,wordpress,codeigniter,internationalization
I have a website build with Codeigniter and I need to have a blog. It should be a WordPress so what I decided to do is to add "blog" in my .htaccess and install a WordPress in myweb.com/blog It works perfect. Now, I need to change my theme header and...

System.NullReferenceException with registry edit in Vb.net

.net,vb.net,internationalization,registry,nullreferenceexception
i have a problem with changing a registry value. i want to set the decimal symbol from "." to "," bud everytime i debug it, it gives a System.NullReferenceException i do partly understand what it means bud i just dont know how to fix the problem. i am using visual...

Converting regex to account for international characters

php,regex,internationalization
I currently have the following regex for validating on inputting a company name into a form: $regexpRange = $min.','.$max; $regexpPattern = '/^(?=[A-Za-z\d\'\s\,\.]{'.$regexpRange.'}$)(?=.*[a-z\d])[a-zA-Z\d]+[A-Za-z\d\'\s\,\.]+$/m'; I need to update this to international standards to allow for international characters. I have zero experience with this Can someone assist in helping me understand how to...

Is there any NuGet package for adding gettext support in C# / ASP.NET? [closed]

c#,asp.net-mvc,localization,internationalization
I search for a NuGet package that adds support for GNU gettext in C# / ASP.NET MVC applications. The only relevant packages I have been able to find (searching on "PO", "i18n" or "gettext") have last-published date back in 2013. This could hint that the packages are not maintained that...

JMS Translation Bundle does not extract keys from controllers in Symfony2 - getTranslationMessages()

symfony2,internationalization,jms,translation
I am using JMS Translation Bundle in my Symfony 2 project. All translations in the twig files are working great. If I write new keys that need to be translated and run the extract command from command line they get extracted and I can then set appropriate values. My question...

how to add Urdu language support in spring web application

java,spring,spring-mvc,internationalization
I need to add Urdu language support to my web application. I created two properties file like below messages_en.properties messages_ar.properties and I configured my spring xml like below <beans:bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <beans:property name="basename" value="classpath:messages" /> <beans:property name="defaultEncoding" value="UTF-8" /> </beans:bean> <beans:bean id="localeResolver"...

Django way for multiple translations for one language or parametrize translations

python,django,internationalization,translation
I have django app which is backend for javascript application intended for multiple TV devices. Each device has different frontend but I don't think that creating multiple .po files is good idea for this goal, because most of translations are repetitive for these devices. Is this possible to add additional...

Best practice for sharing translation of Active Record attributes

ruby-on-rails,activerecord,internationalization,yaml,rails-activerecord
I have the following yaml in one of my translation files: se: activerecord: attributes: user: name: "Namn" town: "Stad" admin: name: "Namn" level: "Nivå" pet: name: "Namn" company: name: "Namn" food: name: "Namn" Is there a way for me to DRY this up and share the translation of name across...

How to use DbMessageSource in yii2

internationalization,yii2,multilanguage
i am using yii2 advanced template.and i dont understand how to use DbMessageSource.i read the guide and i created two tables source_message and message and i wrote in my common/config/main.php file this code '*'=> [ 'class' => 'yii\i18n\DbMessageSource', 'sourceMessageTable'=>'{{%source_message}}', 'messageTable'=>'{{%message}}', 'enableCaching' => true, 'cachingDuration' => 3600 ], and what i...

AngularJS: How to use translation (i18n) in controller for popup?

javascript,angularjs,internationalization
I', writing an app in angularjs and have to do the i18n. Everything's fine but i did the errorhandling and there's the problem: i don't know how to use the translation in controller for popups. My controller looks like this: function showErrorPopup($ionicPopup, $ionicHistory, $location, $translate, error) { if (error.status ==...

Set right-to-left orientation for NSButtonCell

objective-c,osx,internationalization,right-to-left
Right-to-left (RTL) languages expect that the checkbox/radiobutton is to the right of the text in checkbox/radiobutton groups and that the text is right aligned. When I set right-to-left language (Testing Your Internationalized App) most of the elements in the interface are respecting this setting, but checkboxes and radiobuttons are still...

angular-translate module 'pascalprecht.translate' not found

javascript,angularjs,internationalization,angular-translate
I'm trying to add angular-translate to my angular app. I followed this simple quick start: https://angular-translate.github.io/docs/#/guide, but my app won't bootstrap, giving me the following error: Uncaught Error: [$injector:modulerr] Failed to instantiate module myApp due to: Error: [$injector:modulerr] Failed to instantiate module pascalprecht.translate due to: Error: [$injector:nomod] Module 'pascalprecht.translate' is...

Sails.js : use i18n in my controller

node.js,view,controller,internationalization,sails.js
In my controller I want to send a message in my view like that : res.status(400).view('memberRegisterView',{error : "error"}); And I want to translate this error in french and have "erreur". I edited i18n.js : locales: ['en', 'fr'], defaultLocale: 'fr' In my en.json : "error":"error" In my fr.json : "error":"erreur" How...

How to prevent Rails locale=xx in URL (disable)?

ruby-on-rails,routes,internationalization
This is what I have: Rails 4 I18n with three locales enabled. One of these three is default and does not use scopes in routes (thus it works exactly I want). default_url_options enabled and I am aware of it and what exactly it does.. Now, the challenge is to avoid...

Jhipster update i18n language for a user

internationalization,jhipster
I have a Jhipster application and already changed the default language in the app to use french. In app.js: $translateProvider.preferredLanguage('fr'); But I can't change the language that was set for a User. I am using the default User account created with the application: "user". When I logged in the application...

CakePHP - Can't query model that has TranslateBehvior from a shell

cakephp,internationalization
I have a CakePHP model that uses the TranslateBehavior for i18n. In most contexts it works fine, however when I try to retrieve data from it in a CakePHP shell the result is always an empty array. So this: $this->MyModel->find('all') returns lots of records in a controller, but nothing in...

I18n month translation

ruby-on-rails,ruby-on-rails-4,internationalization,rails-i18n
I'm trying to translate a month with I18n and I'm getting this error: undefined method `strftime' for "2015-05-18":String Code: # controller @previous_month = I18n.l(Date.today - (1%12).months) # view @previous_month.strftime('%B') How can I solve this error?...

Text internationalization in Javascript using liferay-ui:message

javascript,internationalization,liferay
How can I do internationalization for this : alert('<liferay-ui:message key="please-choose-file-type" />'); Notice that I want to internationalize the message inside Alert using Liferay:ui:message tag. Thanks....

Translate path with rails i18n

ruby-on-rails,ruby-on-rails-4,localization,internationalization,rails-i18n
I have a rails 4.0.0 app running with friendly_id and globalize (even if freindly_id and globalize might not matter for this question). Part of my routes.rb is: scope "(:locale)", locale: /en|de/ do resources :mainclasses, :path => :types end I now would like to have the ":path => :types" just for...

Using Bootstrap Datepicker Internationally

twitter-bootstrap,datepicker,internationalization
I've been building an app that needs to work internationally. In this app, I'm using the Bootstrap Datepicker. I am able to successfully initializing a date picker using the following: <input id="myDatePicker" class="form-control input-sm" type="text" autocomplete="off" value=""> $('#myDatePicker').datepicker({ autoclose: true, clearBtn: true, language: 'zh-CN', startDate: '01/01/1900', todayHighlight: true }); When...

Symfony 2 setting up translation files

symfony2,internationalization,yaml
I am failing to setup translation for my Symfony 2 project. I have manually created a folder inside app\Resources\translations\message.en.yml and it's content: base: title: homePage: TeamERP IMS for BA Then on the base twig template inside my bundle I am trying to call it: <title> {% block title %} {{...

GWT i18n changing locale

java,gwt,internationalization
I want GWT to first determine the locale of the user by using <set-configuration-property name="locale.useragent" value="Y"/> The URL should be appended with that locale value. Then I'd like to let the user change the language with a listbox and change the URL accordingly. Is this approach possible and does a...

How can I localize my Meteor JS App?

meteor,internationalization
I need to get my Meteor JSapp in more than one language. What would be the best approach for i18n? Google passed my quite a bit of results but reading them I am more confused than happy. There a many hacks but is there a settled solution to this?

How can I use duration() on local moment instance?

javascript,internationalization,momentjs
According to moment.js documentation you could create a local instance of moment to format a date using other locale than is globally set. That works fine with format(), but how can I use duration() on a local instance ? Here is what I tried: moment.locale('en'); var localMoment = moment("2015-03-12"); localMoment.locale('de');...

Pattern to internationalize links in JSF

jsf,design-patterns,internationalization
I want to internationalize the following content: Click here to view our privacy policy. here is a hyperlink. Here is how I currently go about it: #{msg.footer_privacyPolicy1} <h:outputLink> #{msg.footer_privacyPolicy2} </h:outputLink> #{msg.footer_privacyPolicy3} msg is a ResourceBundle registered in faces-config.xml, with the following contents: footer_privacyPolicy1 = Click footer_privacyPolicy2 = here footer_privacyPolicy3 =...

Grails: Organizing i18n bundles

grails,internationalization
I see under grails-app/i18n there are a ton of messages*.properties bundles. I would like to internationalize my app, but have 1 "bundle set" per page. By bundle set I mean, a set bundles/properties files that contain the same text but for different languages. For instance, if I want my site...

Meteor: use dynamic parameters in a template call

validation,templates,meteor,internationalization,spacebars
In my Meteor app i have the TAPi18n package and aldeed:autoform. Im trying to make a form validation using i18n for the placeholder field but i don't know how to do it. So, I was wondering if it is possible to pass a dynamic parameter (that's how I call it)...

How to keep a variable in the URL when using Spring LocaleChangeInterceptor

java,spring,jsp,spring-mvc,internationalization
I have a page at this URL http://localhost:8080/SpringExercises/admin/manageMenuDetail?id=1. I use Spring LocaleChangeInterceptor to handle languages. When I try to change the language by clicking on a link like "?lang=it" I get an error, because id is null. I suppose Spring turns .../SpringExercises/admin/manageMenuDetail?id=1 into .../SpringExercises/admin/manageMenuDetail?lang=it forgetting to write ?id=1 Can Spring...

i18n cakephp 1.3 internatialization

cakephp,internationalization,cakephp-1.3
I'm using CakePHP 1.3 and I'm having some trouble with i18n. There are about 10,000 strings in my project and that's okay. But I'm having huge problems with some of the strings: First string in code: <?= sprintf( __('bla bla bla <span id="count">%s</span> bla', true), $count ); ?> This string...

“Page not found” all over the place with i18n on Drupal?

drupal-7,internationalization,multilingual
I am clearly missing the picture here as just about everything I try is just failing miserably. I have languages as follows: gb-en - UK English (path = /gb/en/about ) us-en - US English (path = /us/en/about ) us-es - US Spanish (path = /us/es/about ) I have an about...

How to get the weekday names using Intl?

javascript,internationalization,ecmascript-intl
I'd like to display in my i18n-ed app a list of the 7 weekdays: Sunday, Monday, Tuesday... Saturday I rely on the Intl global object for formatting date/time but I can't find an easy way to get only the weekday names. I thought I could add some days to the...

i18n: Access locale resolution logic in JavaScript

javascript,localization,internationalization,single-page-application
I'm developing and internationalized Single Page App with 2 sorts of localized text: 'static' text, typically text in my HTML templates. 'dynamic' text, i.e text that lives in the database, typically the description of a product on an e-commerce site. It's type 2 I'm having trouble with. Say my app...

Trying to translate fields of my classes (Django internationalization Cap)

python,django,django-models,internationalization,django-views
Today i am translating my training project, yesterday i was reading The Django book (Cap: Internationalization) and i have achieved translate my templates completely. Now I have a new issue. I have some dynamic content that i wanna translate, but i don't know how proceed beyond add the pseudonym of...

Lithium routes with different locales

php,internationalization,lithium,php-5.5
I have a i18n route in Li3 that looks like: Router::connect('/{:locale:[a-z]{2}/{:args}', [], [ 'continue' => true, 'persist' => ['locale'], ]); This way, when a user (or a crawler) enters my site with a language prefix, the locale is used to generate every link on the site. For SEO purposes, I...

How can i force Android to not use certain language files that are within a used library project?

android,internationalization
I have a library project with several language files, mainly strings. In one app I need to use the library but I want to use only some of the language files (contract reasons). How can I force Android to disregard the existance of languages when building the app ?...

NSLocale.preferredLanguages doesn't change when changing NSUserDefaults

swift,ios8,localization,internationalization
i have been researching this for days now. i have a swift ready application , lately we decided to introduce localization, when i set the system language to the desired language , it works , but when i try to manually change the language it doesn't work. what i have...

Yii2 translation

internationalization,yii2
I have Yii2 - advanced template I kept source language english And the target language is french The system mesages are translated like : Yii::t('yii','Update') is translated "Modifier" But all my custom translations do not work - here is what I did : modified : backend\config\main.php : 'i18n' => [...

Shared behavior state across custom elements

javascript,internationalization,polymer,polymer-1.0
I have these two custom Polymer Elements (Polymer 1.0.3): Displays text to be translated. Displays button to trigger loading of translation. I also have a Behavior that holds the translations (json object) and contains all the functions that make translation possible. This is what I expect to happen: Click the...

How to put HTML code into a .resx resource file?

c#,html,asp.net,internationalization,resx
Strange, that no one asked this before.... I am creating templated HTML emails for 4 languages. I want to put the HTML templates into my .resx files to have easy, internationalized access to them from code. Like so: .resx file: <data name="BodyTemplate" xml:space="preserve"> <value><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"...

Test language switching on Codeship

django,internationalization,codeship
I'm doing a basic test to ensure once the language is switched, the right text is loaded. Locally, the test works but the same test fails on codeship. The code: class LanguageTest(TestCase): def setUp(self): translation.activate("sw") def tearDown(self): translation.activate("en") def test_menu_options_sw(self): for s in TOP_LEVEL_MENUS: self.assertRegexpMatches(response.text, s) The variable TOP_LEVEL_MENUS is...

Python parsing date and find the correct locale_setting

python,datetime,internationalization,locale,datetime-parsing
I have the following date string: '3 févr. 2015 14:26:00 CET' datetime.datetime.strptime('03 févr. 2015 14:26:00', '%d %b %Y %H:%M:%S') Parsing this failed with the error: ValueError: time data '03 f\xc3\xa9vr. 2015 14:26:00' does not match format '%d %b %Y %H:%M:%S' I tried to loop over all locales with locale.locale_alias: for...

Tornado Localisation, set default language

localization,internationalization,locale,tornado
I want to set my default language in my web client to be 'de' when the browser language is 'en' or 'en_US'. I am using tornado localisation. I tried this solution, tornado.locale.set_default_locale('de') but it still shows the web client in english.

Internationalization - how to handle gender?

cakephp,internationalization,cakephp-3.0
I have a cakephp 3 application I'm currently internationalizing. The app is written in french, I'm adding english. I'm using the built in tools of cakephp 3 to do it. There is a sentence in my app that must be translated differently in english whether the user is a man...

Generate english versions of same content on Drupal?

drupal-7,internationalization,multilingual
My website needs to be able to support multiple languages for multiple countries. For example, the US might have English and Spanish, while the UK might only have English. If two countries use the same language, it DOES NOT mean the content is the same. For this reason, I decided...

Struct or class for internationalized name object in .NET?

c#,class,internationalization,coding-style,structure
I've got a Person class and I currently try to add name attributes, either as class or as struct. Background is, thought in global dimensions, not every person's name must consist of given name and family name. So I decided to make it more atomic and create a new general...

lupdate is not getting tr() strings from QObject objects

qt,internationalization,translate
I've been trying to make a simple text editor using QT Creator. This text editor has a translatable UI that supports 3 languages: English, Spanish, and Portuguese. My problem is that every time I run lupdate, string literals in my code that are tagged as translatable (i.e. enclosed in tr()...

How to translate select option elements in Pyramid?

internationalization,pyramid,pylons
Until only a few minutes ago I was using this syntax to translate a select element, and then I found out that these strings (contents of the <option/> elements) are not being captured in the generation of the .pot file, therefore not being added to the strings for translation list....

angular-translate: how to reset translation table dynamically in $translationProvider?

angularjs,internationalization,ionic,translate,angular-translate
I am using angular-translate to display different languages in my application, but I get an error when I try to refresh the translation data after a successful login or via other web service calls. Note: I successfully invoke $translateProvider.useLoader in my "app.config" to set the default translation data. But I...

Plural forms with Java java.util.ResourceBundle

java,internationalization,j2objc
I usejava.util.ResourceBundle for i18n like this: try { resourceBundle = ResourceBundle.getBundle("Messages", locale); } catch (MissingResourceException ex) { logger.log(Level.SEVERE, ex.getMessage(), ex); } String localizedString = resourceBundle.getString("key"); I want to create the plural forms are well. Like: one object two objects How can I define plural forms of localized Strings?...

JSP includes tags for internationalization

java,jsp,internationalization,jsp-tags
I have this structure in my JSP (template.jsp): <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <c:set var="language" value="es" scope="session"/> <fmt:setBundle basename="com.myweb.i18n.text"/> <html> <body> <fmt:message key='login.label.username'/> <jsp:include page='/home/header.jsp' flush='true'/> <jsp:include page='/home/body.jsp' flush='true'/> <jsp:include page='/home/footer.jsp'...

Loading of Java message properties for internalization

java,localization,internationalization,translation,properties-file
I have the following Java i18n Message class.: public class Messages { private static final String BUNDLE_NAME = "languages.message"; private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); private Messages() { } public static String getI18n(String key) { try { return RESOURCE_BUNDLE.getString(key); } catch (MissingResourceException e) { return '!' + key +...

Create correct path by concatenating LTR with RTL strings

javascript,internationalization,filesystemobject
I'm facing a problem in creating correct path by concatenating Arabic folder name with English folder name, the concatenate function seems to work fine if I print the path using document.write(path) which show the correct path but if I pass it to fso.CopyFile(..) I got exception about incorrect path. function...

PHP Date Formatting with IntlDateFormatter

php,date,internationalization
I noticed, that when formatting a date with PHP's IntlDateFormatter the result can be very different depending on the language. Example: $formatter = new IntlDateFormatter("en_GB", IntlDateFormatter::SHORT, IntlDateFormatter::NONE, "Europe/Vienna"); $date = $formatter->format(0); In this example $date will be 31/12/1969 but if I use de_DE as a locale $date is 31.12.69. The...

AngularJS i18n: ngLocale FIRSTDAYOFWEEK and WEEKENDRANGE

angularjs,internationalization
Somewhere in the v1.4.0-betas, Angular i18n files acquired some new attributes like DATETIME_FORMATS.FIRSTDAYOFWEEK. Latest version as of now. Does anyone understand how FIRSTDAYOFWEEK and WEEKENDRANGE work? From my observation, here's what I think was intended DATETIME_FORMATS.DAY always starts on Sunday (consistent with 0 = Sunday in javascript), no matter what...

translation issue in php

php,yii,internationalization,translation
I have done everything that is needed to translation. only issue is this word is not getting translated properly, L’équipe is not getting translated properly, instead of it i am getting L?équipe with a question mark which i dont understand how. This is how the code is written. $body =...

Information for localization

localization,internationalization,units-of-measurement
Is there a list with complete information about caracteristics like: currency date and time (including if it is 12 or 24 hours) format measurement units (distance, speed, temperature...) preferred language masks for phone and local documents timezones (at least the main ones / variations if daylight saving time is applicable)...

How do I use Angular i18n for languages it doesn't appear to support?

javascript,angularjs,internationalization,locale,angular-translate
I am using Angular i18n for German, English, Spanish, French, Italian, Portuguese, Russian, Ukrainian, Japanese, Korean, and Chinese. These are all supported locales, but I've been tasked to include translations for Cebuano, Samoan, Tagalog, and Tongan. These do not appear to be supported locales in Angular i18n. How do I...

What are the differences between i18n and l10n in AngularJS 1.3, 1.4 and 2?

angularjs,localization,internationalization
I have an AngularJS application written using AngularJS 1.4. We need to adapt this to work with different languages and of course sometime in the future we need to move to AngularJS 2.0. Has anyone out there used the i18n and l10n features of both AngularJS 1.4 and 2? From...

Check if model has locale_restriction in scope

mysql,ruby-on-rails,activerecord,localization,internationalization
Consider a model Post which has a title, description and a locale_restrictions field. The locale restrictions field specifies in which locales the post should be displayed. It contains a CSV value: en,de,be,nl. What I would like to do is use either a default_scope or a named scope to only return...

Using babel and lingua in pyramid

localization,internationalization,pyramid,babel
I've problems with babel and lingua. I want babel/lingua to scan my source folder for specific strings for creating the pot-catalog. This is my setup.py ... requires = [ ... 'Babel', 'lingua', ] extractors = { 'dbas': [ ('**.py', 'python', None ), ('**.pt', 'chameleon', None ), ('static/**', 'ignore', None), ]}...

How to disable standard translation loaders in Symfony2

php,symfony2,internationalization,translation
I use a custom storage for translations in Symfony2, but I want to make sure that the translations will be loaded only from my storage, and not from other sources (such as Yaml files). How can I disable the standard loaders? In my custom Translator class I have the following...

Internationalization of api error messages on front end or back end?

java,angularjs,spring,internationalization,angular-translate
My team is currently working on a web project where the front end uses json api provided by the back end. The technology that we use is Spring Boot and AngularJS. The api has the standard error format that looks like this: { "errorCode": "1111", "message": "Error occurred: some error...

Spring MVC 3.1 change language i18n based on the request locale language

java,spring,spring-mvc,internationalization,locale
What I would like to do it to display the appropriate language to the user based on his request.getLocale().getLanguage(); So here is what I already have and which is already working fine. Meaning that when I type ?lang=en or ?lang=cn at the end of the URL it displays the appropriate...

Change Struts 2, i18n classes behavior when key is not found

struts2,internationalization,jsp-tags
We used getText in actions, setMessageKey in validators and <s:text> in jsp files for an i18n application. When Struts 2 could not find a key in resource bundles it returns the key itself. For example form.transfer.confirm . How can we change this behavior in the way that instead of the...

Spring Message Not Displaying

java,spring,jsp,spring-mvc,internationalization
I am trying to do internationalization in Spring-MVC for the first time and I'm having what I assume to be a configuration issue. I have a NLS file that I named NLS_en.properties which I placed in my application's WEB-INF\classes directory. The file contains the following NLS string: MSG_HELLO = Hello...

Spring MVC: message source doesnt seem to point to the properties

java,spring,internationalization
I have been stuck for several days now on this. Here is my WebMvcConfig class: package utils; import Beans.Users; import com.mycompany.fanalweb.backingbeans.Roles; import java.util.HashSet; import java.util.Locale; import java.util.Set; import org.springframework.context.MessageSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; import...

Binding language not work

xml,internationalization,sapui5,sapui,openui5
I create my .properties file (it, en, fr) and I set the i18n Model var oI18nModel = new sap.ui.model.resource.ResourceModel({ bundleUrl: "i18n/i18n.properties" }); sap.ui.getCore().setModel(oI18nModel, "i18n"); this.setModel(oI18nModel, "i18n"); My app start correctly in italian. Now I have a button that switch to en language. This is the code: var bundleLocale=sap.ui.getCore().getModel("i18n").getProperty("/bundleLocale/"); bundleLocale="en"; sap.ui.getCore().getModel("i18n").refresh(true);...

Using a/an on an I18n message

ruby-on-rails,internationalization,rails-i18n
I have the following error message on my en.yml file: invalid_transition: "Cannot %{action} a %{state} timesheet" Problem is that sometimes the state can be approved, other times it can be rejected. With that, the error can end up being mispelled like "Cannot submit a approved timesheet", instead of "an approved...

Cakephp 3.0.0-RC2 I18n::locale() doesn't works

php,cakephp,internationalization,locale,cakephp-3.0
I am using Cakephp 3.0.0-RC2. It work's fine but I can't change du language of the user at login. My login function doesn't work. It do nothing : public function login() { if ($this->request->is('post')) { $user = $this->Auth->identify(); if ($user) { $this->Auth->setUser($user); I18n::locale($user['lang']); return $this->redirect($this->Auth->redirectUrl()); } $this->Flash->error(__("Nom d'utilisateur ou mot...

Regexpression for check if string is locale like locale_Culture

php,regex,localization,internationalization
I want to check if string is locale like en, uk, etc. It I do by this reg exp: /^[a-z]{2}$/ But I want to do this with locales what consis from locale and culture, like en_US, or en_EN. My knowledge of regular expressions is too pure to do this. Can...

How can I copy/pate multibyte characters on Android Emulator?

android,android-studio,internationalization
I got to know how to copy/paste from command line tool at Paste text on Android Emulator adb shell input keyboard text 'foo' It works very well for ascii characters but it doesn't for multibyte characters. adb shell input keyboard text 'あ' Doesn't pass any character to emulator. adb shell...

How do I check if strings called from a ResourceBundle exist without running?

java,internationalization,resourcebundle
I'm using ResourceBundle to get strings from MessagesBundle.properties files, but I can't figure out a way to check to make sure all strings called exist (and aren't mistyped) without actually running the program and looking through exceptions. Is there a tool that lets me check this?

Change language of SwitchPreference

android,localization,internationalization
I have an Android app which is only available in English. Accordingly, all of the UI that's under my control appears in English only, regardless of what language the user has set their device to. The issue is with SwitchPreferences on my app's Settings screen; the "on"/"off" labels on the...

Configure internationalization from application.properties in spring boot

java,spring,spring-mvc,internationalization,spring-boot
I was wondering if I can configure how spring boot handles internationalization using the application.properties file instead of writing it in code. For example: To define a LocaleChangeInterceptor I have to declare a bean like this: <bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"> <property name="paramName" value="lang" /> </bean> However, a look at the most...

i18n in Cakephp 3 + Wordpress

wordpress,internationalization,cakephp-3.0
I'm trying to solve this in the prettiest possible way, i've integrated cakephp in wordpress or wordpress in cakephp that's a matter of how you see it. The wordpress installation exists in the Cakephp /webroot directory and is loaded first by some .htaccess trickery and the Cakephp is mapped to...

Fully Understanding hreflang

html5,internationalization,seo
I have a website which currently displays all prices in US dollars. I'd like to change it to pounds if you are from the UK and euros if you are from France or Germany. The text on the page will always be displayed in English. I've explored the various options...

zk internationalization by LabelLocator

internationalization,zk
I'm tring to make zk internationalization in my project. I have looked through all docs and find out this info: public class FooServletLocator implements org.zkoss.util.resource.LabelLocator { private ServletContext _svlctx; private String _name; public FooServletLocator(ServletContext svlctx, String name) { _svlctx = svlctx; _name = name; } public URL locate(Locale locale) {...