translation

Strings in Applescript depends on the system language - are there universal names?

蹲街弑〆低调 提交于 2019-12-22 01:00:44
问题 I write some Applescripts that are gonna be deployed on machines set to different languages. I just realised that when I, for example, is waiting for an application to open a window (e.g., a Save/Open dialog) my scripts fail because on systems set to other languages these windows are not called Save or Open anymore, but rather have a translated name. How do I handle this? Do windows have "universal base name" I can look for rather than the name I Accessibility Inspector shows? And I guess

symfony translation by using keys

杀马特。学长 韩版系。学妹 提交于 2019-12-22 00:37:35
问题 If I want to translate content in symfony, I will use the translator as it is described in the book: $translated = $this->get('translator')->trans('Symfony2 is great'); But, if this translations are already existing in a database, how can I access this? The db looks like ID | locale | type | field | content 1 | en | message| staff.delete | delete this user? I wil have to tell the translator where he can get the translation information. Cann you help me with a good tutorial or tipps an tricks?

Strings in Applescript depends on the system language - are there universal names?

二次信任 提交于 2019-12-22 00:34:01
问题 I write some Applescripts that are gonna be deployed on machines set to different languages. I just realised that when I, for example, is waiting for an application to open a window (e.g., a Save/Open dialog) my scripts fail because on systems set to other languages these windows are not called Save or Open anymore, but rather have a translated name. How do I handle this? Do windows have "universal base name" I can look for rather than the name I Accessibility Inspector shows? And I guess

Routing Zend Framework 2 Language in url

纵饮孤独 提交于 2019-12-21 17:23:42
问题 For my application translation I would like to use a language structure e.g.: site.com (english) site.com/de/ (german) site.com/fr/ (france) site.com/nl/ (dutch) etc.. I can do this easily with the router option in Literal as '[a-z]{2}' but I want to exclude languages I do not support, e.g. site.com/it/ if it is not supported I want a 404. I tried to fix this with regex (adding supported languages) but something (I do not know) went wrong. Thanks in advance! 'router' => array( 'routes' =>

C# to VB.NET: the **default** keyword? [duplicate]

夙愿已清 提交于 2019-12-21 07:02:17
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Default value for generics OK, so while translating some code from C# to VB.NET, I came across the default keyword, and I'm simply replacing it with nothing . Is this the proper way to do it, or is there a better "translation" for that keyword? 回答1: Yup, that's absolutely fine. While Nothing is usually meant to mean the equivalent of C#'s null , it can be used with value types to, to mean "the default value of

C# to VB.NET: the **default** keyword? [duplicate]

这一生的挚爱 提交于 2019-12-21 07:02:09
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Default value for generics OK, so while translating some code from C# to VB.NET, I came across the default keyword, and I'm simply replacing it with nothing . Is this the proper way to do it, or is there a better "translation" for that keyword? 回答1: Yup, that's absolutely fine. While Nothing is usually meant to mean the equivalent of C#'s null , it can be used with value types to, to mean "the default value of

Access translation file (i18n) from inside rails model

此生再无相见时 提交于 2019-12-21 06:46:36
问题 What I have in my model is: def body_color_enum [ ['Aqua', '#009c9c'], ['Grey', '#6d6e71'], ['Yellow', '#ffe600'], ['White', 'white'] ] end I want these values to come from the translation file 'en.yml' en: group: hero: hex1: '#6d6e71' name1: 'Dark grey' hex2: '#ccc' name2: 'Light grey' hex3: '#0099ce' name3: 'Blue' hex4: '#ffffff' name4: 'White' I have tried this: def body_color_enum [ [t('group.hero.name1'), '#009c9c'], ['Grey', '#6d6e71'], ['Yellow', '#ffe600'], ['White', 'white'] ] end

Polylang: How to translate custom strings?

杀马特。学长 韩版系。学妹 提交于 2019-12-21 04:39:45
问题 My problem : I'm translating my website using Polylang but I'm having a hard time with custom strings translation. The strings won't show up in the "Strings translation" menu in the WP dashboard. Important: I don't know much about PHP so the pll_register_string function is very confusing for me. Quoted from the Polylang doc: https://polylang.wordpress.com/documentation/documentation-for-developers/functions-reference/ pll_register_string Allows plugins to add their own strings in the “strings

Auto translating website using Google Translate

不羁的心 提交于 2019-12-21 03:15:34
问题 I need to find a way to translate a website to the appropriate language as the locale settings on a users machine. So in otherwords someone from Germany visits my site, his locale settings are GErman, nou the site displays in German, is this possible to do using Google Translate or are there other options available? 回答1: I know that when I visit a site in another language using Google Chrome, it says "This site appears to be in [Drop Down With Languages]. Do you want Google to translate it?"

Symfony2 twig translate variable values in {% trans %} tag

你。 提交于 2019-12-20 12:25:05
问题 I'm working on a Symfony2 project and have a question from it. In one twig template I receive a variable from controller. It's a string and I need to translate it. But the syntax {% trans %}{{ post['name'] }}{% endtrans %} returns error "A message must be a simple text in...". So is there a way to translate the variable values??? 回答1: Use filters: {{ post['name']|trans }} 来源: https://stackoverflow.com/questions/9632502/symfony2-twig-translate-variable-values-in-trans-tag