internationalization

Grails: how to collect all messages

陌路散爱 提交于 2019-12-22 05:26:13
问题 I am new to Grails and I have inherited an existing application. I have a big file message.properties that I would like to prune, in order to remove keys that are no longer used. In Django there is a command makemessages that goes through all codebase and collects all strings that need translation, adding them to the messages file and commenting out the entries that no longer exist. Is there a similar tool for Grails? If it helps, the project is based on verions 1.3.9. 回答1: There is no such

How can I get and parse Accept Header to get language at JavaScript?

不想你离开。 提交于 2019-12-22 05:22:06
问题 How can I get and parse Accept Header to get language as two character => en, tr, ar, fr, etc. at JavaScript? EDIT: When I use navigator.language or something like that it gives me a language. However I am using a plug-in at Firefox, Quick Locale, it changes the local. When I change it from English to Arabic, still navigator.language says that I am using English. However when I connect to www.google.com, after I changed locale with Quick Locale, Google's homepage opens at Arabic language. I

One column SQL table, the column being an ID - is this crazy?

旧街凉风 提交于 2019-12-22 05:15:53
问题 I am designing a database which will be used for internationalized content. One of the features is a tagging system, similar to what Stack Overflow has. This is what I've got: TABLE tags tag_id | int(11) unsigned | NOT NULL | PRI | auto_increment TABLE tag_translations | tag_translation_id | int(11) unsigned | NOT NULL | PRI | auto_increment | fk_language_id | int(11) unsigned | NOT NULL | MUL | | fk_tag_id | int(11) unsigned | NOT NULL | MUL | | tag_name | varchar(255) | NOT NULL | UNI |

Rails: changing locale and keeping page parameters

跟風遠走 提交于 2019-12-22 05:02:50
问题 I have a navbar with links to different languages: <%= link_to t('header.english'), locale: "en" %> The problem is when user tries to switch language on a page which contains additional parameters in the url. Changing locale at this point reloads the page and strips all the additional parameters. So, how do I pass all the parameters from the current page to the locale switch link? For example, when /page/new?param1=1&param2=2 is open, and user switches the locale, /page/new?locale=en is

WrapText for WideString in Delphi

拟墨画扇 提交于 2019-12-22 05:01:03
问题 Delphi has a WrapText function: function WrapText(const Line, BreakStr: string; const BreakChars: TSysCharSet; MaxCol: Integer): string; function WrapText(const Line: string; MaxCol: Integer): string; Now i need a version that handles WideStrings: function WrapTextW(const Line: WideString; MaxCol: Integer): WideString; Is any such function written somewhere already? WARNING: Not every wide string character is 2-bytes Which is why i'm afraid to write it Update : Example of a character that

How do I add I18n locale dictionaries from gem to Rails Application

强颜欢笑 提交于 2019-12-22 04:26:12
问题 I have a gem that makes use of I18n locale dictionaries that reside in lib/locales/*.yml inside my gems folder. When the gem is initialized I want to load these dictionaries into my rails application, but I cannot figure out how: This is what I tried: I18n.load_path += Dir.glob("lib/locales/*.{rb,yml}") Unfortunately this does not work when the gem is loaded inside my Rails App. When I call I18n.t("foo") I get "translation missing: en, foo" . I will probably have to provide the full path to

Insert array into database in a single row

烂漫一生 提交于 2019-12-22 04:22:10
问题 I wonder if this would be doable ? To insert an array into one field in the database. For instance I have a title, I want to have that title with only one id, but it's going to be bilingually used on the website. It feels a bit unnecessary to make another table to have their global ids and then another table with the actual titles linked to the table with the global id. I just want to have something like this ID TITLE 1 Array("english title", "nederlandse titel"); I'm using PHP/MSYQL, so if

Which computer assisted translation format should I use for a ColdFusion site?

淺唱寂寞╮ 提交于 2019-12-22 04:00:16
问题 I am creating a multilingual site that will need to support at minimum five different languages, including Korean and Chinese. The site language is ColdFusion, so Java is the native language. I want to make the site as easy as possible for the next programmer to update, and for third-party translators to use tools that will work easier for them than digging through a SQL database. So far I have come across Resource Bundles, GNU's GetText, and TMX. Which do you recommend and why? 回答1: Resource

“Intl not available” in Edge 15

♀尐吖头ヾ 提交于 2019-12-22 03:53:14
问题 I'm seeing an Intl not available error in the JS console when my script runs the following code in Edge 15: new Date().toLocaleDateString() I'm a bit stumped by this. It is working just fine in Edge 14, and I can't find any reference to the internationalization API suddenly disappearing from Edge 15. I'm not sure if this is the proper way to test it, but running window.hasOwnProperty("Intl") in the console actually returns true . To me this seems to indicate that Intl actually is there.

Filtering a list of strings based on user locale

情到浓时终转凉″ 提交于 2019-12-22 03:44:12
问题 When working on a JavaScript project with AngularJS 1.6, I have a list of strings which I'd like to filter. For instance, assume my list contains árbol , cigüeña , nido and tubo . When filtering strings in Spanish, if I filtered for "u", I'd expect both cigüeña and tubo to appear, which would be the most natural result for a Spaniard. However, this is not the case in German - u and ü are different letters and thus a German will not want to see cigüeña on the list. So I am looking for a way to