translation

Can I automatically update msgids in gettext's .po files for trivial text changes?

家住魔仙堡 提交于 2020-01-01 05:22:07
问题 With gettext, the original (usually English) text of messages serves as the message key ("msgid") for the translations. This means that every time the original text changes, the msgid must be updated in all the .po files. For real changes of the text, this is obviously unavoidable, as the translator must update the translation. However, if the change of the original does not change its meaning, re-translation is superflous (e.g. change in punctation, whitespace changes, or correction of a

translation in JS?

筅森魡賤 提交于 2020-01-01 04:31:10
问题 Basically need to generate custom(some different then yes no) messeges(alert) in JS , how to deal with translation in it? 回答1: Plese take a look at jQuery-i18n translation plugin var my_dictionary = { "some text" : "a translation", "some more text" : "another translation" } $.i18n.load(my_dictionary); $('div#example').text($.i18n._('some text')); And jQuery localisation $.localise('js/greeting'); $('#greeting').val(greeting); $('#languages').val($.localise.defaultLanguage); $('#changeLocale')

Quantity “two” not working in Android Strings-Resources Plural

天涯浪子 提交于 2020-01-01 04:30:10
问题 Android allows translators to define Plurals. The following example works for me with locale 'en': <plurals name="numberOfSongsAvailable"> <item quantity="one">One song found.</item> <item quantity="other">%d songs found.</item> </plurals> But adding a special value for two does not work, still the other version is taken. Is the usage of two dependent upon the locale? So does Android only take the two version if the locale explicitly specifies that there should be a two version? The SO

Temporary removal of HTML from string for Google Translate API to reduce cost

南笙酒味 提交于 2019-12-31 04:18:05
问题 I have to translate some details using a Google API which we're paying for. The details contain HTML, and Google charges for each character. I don't want to send the complete content, but only the English text instead, with the HTML removed. I can remove HTML tags and entities using PHP functions, but I have to place the English content back in the HTML tags after translation for proper display. It will also include CSS. Example: <strong>This is a test</strong><br />   <custom tag>This is a

Qt Dynamic translation of dialog windows

你说的曾经没有我的故事 提交于 2019-12-30 11:55:31
问题 I am creating a Qt application and I added dynamic translation (I followed the example at http://www.qtcentre.org/wiki/index.php?title=Dynamic_translation_in_Qt4_applications) with a QCombobox which lists different languages. It works well but the problem is that I don't see how to translate dynamically the text in the dialog windows (for example YES and NO buttons). In the main.cpp, before executing the app, I have : QTranslator qtTranslator; qtTranslator.load("qt_" + QLocale::system().name(

google API translate, only a div into page

落爺英雄遲暮 提交于 2019-12-30 10:06:03
问题 I have an HTML page, and I would use Google Translate to translate only a div into my page. <div id="google_translate_element"></div><script> function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'it'}, 'google_translate_element'); } </script><script src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> With this code, google translate everything in the page. But if I wanna translate only a piece. How I can do

CodeIgniter: Parse dynamic language captions located in javascript

ⅰ亾dé卋堺 提交于 2019-12-30 07:19:08
问题 I have a javascript code that needs localisation, ie. function js_proc() { var some_data = 'this text needs to be translated dynamically at runtime'; } So I re-wrote like this: function js_proc() { var some_data = <?php echo $this->lang->line('some_data_id'); ?>; } In the view, I wrote the js link like this: <script type="text/javascript" src="www.domain.com/codeigniter/get_js/file-1/"></script> which calls the function get_js() in the controller. The idea is to have the get_js() function

Translating using variables in Symfony2 + Twig is possible?

独自空忆成欢 提交于 2019-12-30 06:32:01
问题 The first output the string not translated: {{ chart.name~'.short'|trans({}, "charts") }} This one works (is the same text that chart.name~'.short' should output): {{ 'charts.region.area.short'|trans({}, "charts") }} Am i missing something? It seems it's impossible to translating dynamic text in Twig? EDIT : working setting a variable (why?): {% set name = chart.name ~ '.short' %} {{ name|trans({}, "charts") }} 回答1: Symfony/Twig is trying to translate .short and concatenate it with contents

How do you translate EXT:Form forms in TYPO3 CMS 8.7 LTS?

我是研究僧i 提交于 2019-12-29 09:37:11
问题 I'm new to TYPO3 and starting out with 8.7 LTS. I have created several forms with the default "form" extension. My site requires some of these forms to be translated into up to 5 other languages. So far the only solution I've found is to copy the forms and then have a separate form for each translation, but this does not seem like the best solution, as long term it would lead to form divergence. Is it possible to add alternate translations directly in the YAML file or point to a translation

How to add a new language for mysql's error messages?

ぃ、小莉子 提交于 2019-12-29 08:17:32
问题 In $MySqlHome/share folder, there are 25 subfolders (25 languages) and errmsg-utf8.txt file which contains translations of the error messages. Under each subfolder there is a errmsg.sys. I'd like to add a new language (zh-CN) and translate some of the messages. How to do this? 回答1: The source file to edit is sql/share/errmsg-utf8.txt At the top of this file, a line like languages ... french=fre ... declares the list of languages with abbreviations. During the build, the program comp_err