translation

Translating G-Machine source to LLVM IR

孤者浪人 提交于 2019-12-07 02:48:47
问题 I'm implementing a simple lazy functional language with LLVM as its backend in Haskell. I've read two books written by Simon Peyton Jones ("The implementation of functional programming languages", as well as "Implementing functional languages: the tutorial") and based on that I managed to implement the G-Machine compiler and interpreter. I'm now currently stuck on the problem of generating LLVM IR code from G-Machine instructions. The main problem is that G-Machine is a stack machine whereas

Umbraco 7 Working with languages/Dictionary

冷暖自知 提交于 2019-12-07 01:04:19
问题 Our project has finally come to a point where we can add translations. I just cant seem to figure out how to actually work with languages in Umbraco 7. Ive added a language and a few dictionary items in the backend, but how do i select the givent language in my code? Are there any helpers to get translations in the API? Like DictionaryHelper.Translate("Answers","da-DK"); ? Or similar? Is there a way to set the language, etc in the startup controller, and just always get that language from the

A proper workflow for CMake + Qt translation system

霸气de小男生 提交于 2019-12-07 01:02:31
问题 I recently moved my Qt project form qmake to CMake build system and now I'm trying to set up a translation system. I tried to use qt5_create_translation macro (documented here) to update my *.ts files and generate *.qm files. By default the macro creates (or updates) *.ts files in the source directory and *.qm files in the build directory, which is pretty logical and convenient to use. The nature of underlying lupdate utility is such that *.ts files cannot be destroyed - they may be updated

C++, Multilanguage/Localisation support

安稳与你 提交于 2019-12-07 00:33:31
问题 what's the best way to add multilanguage support to a C++ program? If possible, the language should be read in from a plain text file containing something like key-value pairs (§WelcomeMessage§ "Hello %s!"). I thought of something like adding a localizedString(key) function that returns the string of the loaded language file. Are there better or more efficient ways? //half-pseudo code //somewhere load the language key value pairs into langfile[] string localizedString(key) { //do something

Magento, translate validation error messages

牧云@^-^@ 提交于 2019-12-06 23:56:04
问题 I have successfully created new rules for the prototype validation, now I need to translate the error messages (Location: String in Javascript). However, I can only translate all the messages, my new custom ones don't appear to be translatable. How do I change this? 回答1: Maybe you need an jstranslator.xml file inside etc folder: <?xml version="1.0" encoding="UTF-8"?> <jstranslator> <some-message-name translate="message" module="mymodule"> <message>This is the text in my own js validation<

How to get the available translations from a dll

不想你离开。 提交于 2019-12-06 22:24:50
Is there a way to get the available resource translations of a .net dll? Our software is being translated in some different languages, and I would like to give the user the choise of what language the software is in, although I would only like to let them choose only between the languages it has been translated in. I just got similar problem so just for future reference. For my software translations are in the program folder, each under their own subfolder named after culture name. Code explains it all: private void SettingsForm_Load(object sender, EventArgs e) { // load default language to

Symfony 4.4 Translation interface problem

坚强是说给别人听的谎言 提交于 2019-12-06 20:52:30
Recently upgraded app from Symfony 4.3 to 4.4 and in production I have problem with Symfony Translator interface config: framework: default_locale: pl translator: default_path: '%kernel.project_dir%/translations' error: Fatal error: Declaration of Symfony\Component\Translation\TranslatorInterface::setLocale($locale) must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale) in ./vendor/symfony/translation/TranslatorInterface.php on line 24 Fatal error: Declaration of Symfony\Component\Translation\Translator::trans($id, array $parameters = Array,

How to Integrate Qt4 qm files into binary using cmake and QRC?

北城以北 提交于 2019-12-06 18:51:50
问题 I have a Qt4 CMake project and I'd like to integrate the QM files for i18n into the output binary. These are the rules I have so far for generating the TS and QM files: set(myapp_TRANSLATIONS i18n/myapp_de.ts ) set(FILES_TO_TRANSLATE ${myapp_SRCS} ${myapp_MOC_HDRS} ) QT4_CREATE_TRANSLATION(QM_FILES ${FILES_TO_TRANSLATE} ${myapp_TRANSLATIONS}) QT4_ADD_TRANSLATION(QM ${myapp_TRANSLATIONS}) I tried the following to add the QM files to the executable: add_executable(myapp ${myapp_SRCS} ${myapp

How to translate models in Sails.js?

戏子无情 提交于 2019-12-06 13:01:15
问题 I'm working on a simple app with a few models which need to have multilingual attributes. E.g., a model "Article" with a "title" string attribute should have translation for English and French. I'm aware that Sails.js ships with I18n node module, but that seems to handle hardcoded string translations only. Does anyone have any experience with this or sample code to point me to? I'm looking for a best practice here, if possible. 回答1: You can do it 2 ways: 1.) Duplicate the fields in you model

lupdate and conditional includes in a .pro file

耗尽温柔 提交于 2019-12-06 12:03:17
I have a .pro file that contains conditional includes, like this: contains(CONFIG, embedded) { SOURCES += a.cpp HEADERS += a.h } else { SOURCES += b.cpp HEADERS += b.h } When I run lupdate tool (lupdate myproject.pro) from a terminal, only b.h and .cpp are processed (because embedded is not in the CONFIG variable). How can I let lupdate process ALL files contained in the .pro file? As a last resort, you could use the lupdate mode that doesn't care about the pro file but instead just scans files: lupdate [options] [source-file|path]... -ts ts-files 来源: https://stackoverflow.com/questions