4D v16インターフェースの国際化 (XLIFF) |
||
|
4D v16
インターフェースの国際化 (XLIFF)
インターフェースの国際化 (XLIFF)
ビデオ中で説明されている操作の他、以下の点にも留意してください。 XLIFFファイルを使用するためには、ファイルを以下の場所に配置しなければなりません:
*[Lang]は言語コードです。例えば日本語の場合ja.lprojフォルダーです。 デフォルトで4Dは使用するランゲージを以下の順番で決定します:
We're going to learn how to implement XLIFF translation files that you use to localize the entire interface. It's simple: you just replace the texts found in the interface by a reference to an external file containing the desired texts. This will be in the form ":xliff: and an object name" for example "bOK" which is the reference of the OK button. We see here that the text has changed from "Finish" to "OK". Because in the resources subfolder of the database folder, there is a folder for each language.
It turns out that we have a resource called bOK where the text contained in the Target is "OK". If we change this to "Finish" and we save the file and go back to 4D, the text "Finish" is replaced. We can test this here:
For all the text of the interface, we need to replace:
Currently, we are in the en.xlf file so all the "target" text names are in English. Let's create an entry for the text called "Add". The file was saved. Here, if we replace the text with ":xliff:bAdd", we retrieve the text "Add". That's for the English version. Now we're going to retrieve this entry, close the file and open this file in the French folder. We add the unit in question "Ajouter" and save. Now imagine we want to work on a French system.
So we're going to quit our test database and start it again. And can see that the text "Add" has been replaced by the French version (Ajouter). If we want, we can:
Now we just need to create the other entries, "Tout selectionner Tous les enregistrements" for example, and here we indicate that the button is a reference (":xliff:bAll") and that we do in fact have the text "Tout selectionner Tous les enregistrements". Now we're going to go back to the English system so we need to quit 4D. When we restart, we find the text from earlier; however, in the English file, we did not indicate the translation of the "bAll" entry, so in this case, the XLIFF reference is shown. So we need to:
An important complementary element in implementing XLIFF files concerns the character strings in methods. Let's go back to the Test_Variables form that we created and where we assign values to the pop-up menu that has 3 texts here.
Here we see the "Text1Test" text that is:
We're going to:
|
プロパティ
プロダクト: 4D
履歴
ARTICLE USAGE
セルフトレーニング ( 4D v16) |