JP2006146619A - System for creating global program - Google Patents
System for creating global program Download PDFInfo
- Publication number
- JP2006146619A JP2006146619A JP2004336594A JP2004336594A JP2006146619A JP 2006146619 A JP2006146619 A JP 2006146619A JP 2004336594 A JP2004336594 A JP 2004336594A JP 2004336594 A JP2004336594 A JP 2004336594A JP 2006146619 A JP2006146619 A JP 2006146619A
- Authority
- JP
- Japan
- Prior art keywords
- file
- translation
- internationalized
- source
- programming
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Stored Programmes (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
Description
本発明は、国際化対応のプログラムの作成システムに関する。 The present invention relates to an internationalized program creation system.
従来のプログラムは、各国語対応のものがそれぞれ存在しており、国際化対応プログラムを作成する場合は、それぞれのプログラミング言語で定められた国際化対応のプログラミングルールに従って作成する必要がある。すなわち、プログラミングコードで翻訳される文字列に対して一意の識別子を割り当てて記述したり、又は、国際化対応の関数を呼び出したりと、国際化を意識した処理コードを記述する必要があり、開発者の負担になっていた。 Conventional programs exist in each language, and when creating an internationalization program, it is necessary to create it according to the internationalization-compliant programming rules defined in each programming language. In other words, it is necessary to write a processing code that takes internationalization into account, such as assigning a unique identifier to a character string translated by programming code, or calling a function that supports internationalization. It was a burden on the person.
特に、プログラム開発時において、国際化対応を考慮していないプログラムを国際化する場合には、プログラムを修正する必要があるため修正に起因するプログラムのバグが増え修正に時間がかかることが多くなる。また、コーディングにおいて無理をしながら国際化対応することで、プログラムの処理の流れが見えにくくなるという問題もあった。すなわち、国際化対応されていないプログラムコードを国際化対応するには、プログラムコードの修正が必要となり、翻訳する前の段階で多くの時間と労力とが必要となっていた。 In particular, when internationalizing a program that does not take into account internationalization during program development, it is necessary to modify the program, so the number of bugs in the program resulting from the modification increases and it takes time to correct. . In addition, there is a problem that it becomes difficult to see the flow of program processing by coping with internationalization while forcing coding. That is, in order to internationalize a program code that is not internationalized, it is necessary to modify the program code, and much time and effort are required before translation.
特許文献1に記載の技術では、オペレーティングシステムに自動翻訳の機能を付加することにより国際化対応のプログラムの作成を容易にしている。 In the technique described in Patent Document 1, an internationalized program is easily created by adding an automatic translation function to an operating system.
上記特許文献1に記載の技術は、プログラムの国際化対応を容易にはするものの、国際化を予め考慮していないプログラムには元々対応していない。従って、オペレーティングシステムが提供する翻訳機能を利用するためには、国際化を予め考慮していないプログラムではプログラムコードを修正する必要がある。プログラムが完成した後に、固定文字列をオペレーティングシステムの自動翻訳の対象とするためにはプログラムコードの修正が必要となり、プログラムコードの品質に影響するという問題がある。 Although the technique described in Patent Document 1 facilitates internationalization of programs, it does not originally support programs that have not been considered in advance. Therefore, in order to use the translation function provided by the operating system, it is necessary to modify the program code in a program that does not take internationalization into account in advance. After the program is completed, in order to make the fixed character string a target for automatic translation of the operating system, it is necessary to modify the program code, which affects the quality of the program code.
本発明の目的は、プログラミング言語ごとに定義されている国際化のルールに従うことなく、国際化対応のプログラムを自動的に作成するためのプログラミング環境を提供することにある。 An object of the present invention is to provide a programming environment for automatically creating an internationalized program without following internationalization rules defined for each programming language.
本発明は、国際化対応のプログラミングルールに従っていないプログラムコードを自動的に国際化対応のルールに従ったものに変換し、その過程で抽出した文字列を翻訳し、国際化対応プログラムを作成するプログラミング環境を有しており、より具体的には、国際化対応されていないプログラムコード(ソースファイル)を入力として受け付け、翻訳ファイルを取り出す手段と、翻訳ファイルを翻訳してプログラミング環境で受け付けるリソースファイルの形式に変換する手段と、ソースコードとリソースファイルとをビルドし国際化対応プログラムを生成する手段と、を有する。 The present invention automatically converts a program code that does not comply with internationalization-compliant programming rules into a program code that conforms to internationalization-compliant rules, translates a character string extracted in the process, and creates an internationalization-compliant program More specifically, there is a means for accepting program codes (source files) that are not internationalized as input, taking out translation files, and translating the translation files and receiving them in the programming environment. Means for converting to a format, and means for building a source code and a resource file to generate an internationalized program.
本発明によれば、国際化対応されていないプログラムコードに基づいて自動的に国際化対応のプログラムを作成することができる。部分的に国際化の修正が施されたプログラムコードであっても、本発明により対応可能である。 According to the present invention, an internationalized program can be automatically created based on a program code that is not internationalized. Even program code partially modified for internationalization can be handled by the present invention.
また、自動翻訳機能が十分正確なものであれば、途中結果で生成される翻訳ファイルの修正をすることがなく、もしくは最小限の修正で、国際化対応のプログラムを迅速に開発することができる。 Moreover, if the automatic translation function is sufficiently accurate, it is possible to quickly develop internationalized programs without any modification of translation files generated as a result of intermediate processing or with minimal modifications. .
さらに、複数のプログラミング言語で構成されているプログラムコードに基づいて、それぞれのプログラミング言語で定義されている国際化対応ルールに従うことなく、国際化対応のプログラムを作成することが可能である。また、自動翻訳された結果を変更する場合も、プログラミング言語にかかわらず翻訳ファイルの形式が同じであるため、翻訳作業を効率よく行えるという利点がある。 Furthermore, it is possible to create an internationalized program based on program codes composed of a plurality of programming languages without following the internationalization rules defined in the respective programming languages. Also, when the result of automatic translation is changed, the translation file format is the same regardless of the programming language, so that there is an advantage that translation work can be performed efficiently.
以下、本発明の一実施の形態による国際化対応のプログラム作成システムについて図面を参照しつつ説明を行う。図1は、本実施の形態による国際化対応のプログラム作成システムの一構成例を示す図である。 An internationalized program creation system according to an embodiment of the present invention will be described below with reference to the drawings. FIG. 1 is a diagram showing a configuration example of an internationalized program creation system according to the present embodiment.
図1に示すように、本実施の形態による国際化対応のプログラム作成システムは、プログラミング環境A120と、プログラミング環境B121と、を有している。プログラミング環境A120は、プログラムコード(ソースファイル)101を、ソースファイル改103と対応ファイル105と翻訳ファイル104とに分離する翻訳ファイル分離処理部102と、翻訳ファイル104を自動翻訳し翻訳結果ファイル107を生成する翻訳エンジン106と、対応ファイル105と翻訳結果ファイル107とからリソースファイル109を生成するリソース変換処理部108と、を有している。プログラミング環境B121は、ソースファイル改103とリソースファイル109とから実行ファイル111を生成するコンパイル/ビルド処理部110を有する。
As shown in FIG. 1, the internationalized program creation system according to the present embodiment includes a programming environment A120 and a programming environment B121. The programming environment A 120 includes a translation file
ソースファイル101は、国際化対応のルールに従っていないプログラミングコードが記述された複数のファイルを含んで構成されている。翻訳ファイル分離処理部102は、ソースファイル101から国際化対応されていない、即ち日本語、英語等の特定の自然言語で記述された文字列を検索して抽出し、これに基づいて翻訳ファイル104を作成する。また、ソースファイル101の中で自然言語をそのまま記述していた箇所は、その部分を自然言語に依存しない識別子に置き換えて、国際化対応された形式のソースファイル改103を作成し、識別子と自然言語文字列との対応関係は、対応ファイル105で記述する。例えば、ソースファイル101に「Show Message(“ファイルを削除しますか?”)」という記述があった場合、“ファイルを削除しますか?”の部分は自然言語で記述されているため、抽出して翻訳ファイル104に出力し(図3−1参照)、この部分を識別子ID_0001に置き換えた記述「Show Message(ID_0001)」をソースファイル改103に出力する(図4参照)。また、識別子ID_0001と自然言語“ファイルを削除しますか?”との対応関係は、対応ファイル105に出力する(図5参照)。各図面の内容については、後に詳述する。
The
このように、翻訳ファイル104が生成されることにより、国際化対応されていない文字列が分離されるとともに、プログラミング環境Bが処理できるソースファイル改103と、ソースファイル改103との対応関係を後述する識別子により保持している対応ファイル105と、が生成される。
Thus, by generating the
図2は、ソースファイル101から国際化対応されていない文字列を検索して抽出された翻訳ファイル104のファイル形式例を示す図である。図2に示すように、翻訳ファイルの1行目210は、例えば、”Japanese”(日本語)や”English”(英語)や”Chinese”(中国語)のような自然言語を特定する言語識別子1〜Nまでが記述される。その翻訳対象の言語数Nだけ列を設けることで、複数の自然言語に翻訳することができる。翻訳ファイル104の1列目201は、翻訳の対象となる言語1の文字列が記述され、2行目202以降には、翻訳された文字列(言語2からNまで)が記述される。1処理で複数の自然言語に翻訳することができるため、処理が効率的になるという利点がある。
FIG. 2 is a diagram illustrating a file format example of the
図3−1は、日本語から英語に翻訳を行う場合の翻訳ファイル104の具体的な例を示す図である。この場合には、翻訳ファイル104には、“ファイルを削除しますか?”、“致命的なエラーが発生しました。”などの日本語が記載される。次に、翻訳ファイル104内の内容は、翻訳エンジン106により翻訳処理され、翻訳結果ファイル107が生成される。翻訳エンジン106は、翻訳ファイル104の1列目の文字列を翻訳して2列目以降に翻訳結果を記述することにより、翻訳結果ファイル107を生成する。複数の言語に対応させるためには、複数の言語に対応した翻訳エンジンが必要になる。翻訳エンジンは、例えば対訳を記載したテーブル形式であっても良い。多国語に翻訳する場合には、多国語対応対訳テーブルを有しているのが好ましい。
FIG. 3A is a diagram illustrating a specific example of the
図3−2は、図3−1の翻訳ファイルを翻訳エンジン106により処理した結果として作成された翻訳結果ファイル107の構成例を示す図である。日本語で“ファイルを削除しますか?”を英語の“Do you want to delete the file?”に、日本語の“致命的なエラーが発生しました。”を“A fatal error occurred.”に、翻訳している。但し、翻訳エンジン106は辞書をベースとした自動翻訳を行うプログラムであるが、翻訳結果に不適切なものがある場合は、翻訳結果ファイル107の2列目以降の記載(翻訳結果)を手作業で修正することも可能である。翻訳エンジンを利用することで翻訳作業はより迅速にできるが、翻訳エンジン自体は完全な翻訳を約束するものではないため、このような手作業による修正を行うことにより、精度の高い翻訳結果を得ることができる。尚、その後に同様の翻訳作業をする場合も多いため、学習機能を有した辞書により新たな対訳を追加できるようにするのが好ましい。
FIG. 3B is a diagram illustrating a configuration example of the
ソースファイル改103は、前述したように、ソースファイル101のうち自然言語に依存する文字列を識別子に置き換えて、自然言語に依存せず国際化対応した形式に改造したソースコードである。 図4は、ソースファイル101が翻訳ファイル分離処理部102によってソースファイル改103に変換される例を示したものである。国際化対応を全く考慮されていない、即ち自然言語をそのまま記述した“(ダブルクオート)で囲まれた文字列に対して一意の識別子401を割り当てることで、国際化プログラムを考慮したソースコードへの変換を行っている。識別子401は、1つの文字列に対して1つずつ割り当てられ、翻訳する文字列分の数の識別子が使用される。Show Message(“ファイルを削除しますか?”)は、Show Message(ID_0001)に、Show Message(“致命的なエラーが発生しました。”)は、Show Message(ID_0002)に、変更されている。
As described above, the
対応ファイル105は、識別子401と自然言語文字列とを対応付けるためのファイルであって、翻訳結果ファイル107をリソース変換処理部108においてリソースファイル109に変換するために必要とされる。図5は、対応ファイル105の構成例を示す図であり、ID_0001は、“ファイルを削除しますか?”に、ID_0002は、“致命的なエラーが発生しました。”に対応付けされている。リソース変換処理部108は、対応ファイル105と翻訳結果ファイル107とから、リソースファイル109を生成する処理を行う。リソースファイル109は、コンパイル/ビルド処理110で処理できる形式、すなわち、プログラミング言語で定義された国際化プログラミングのルールに従ったもの、例えば図6に示すような形式になっている。すなわち、ID_0001 = “Do you want to delete the file?”;、 ID_0002 = “A fatal error occurred”;というような変換が行われる。
The
ソースファイル改103とリソースファイル109とは、それぞれプログラミング言語で定義された国際化プログラミングのルールに従ったファイルである。従って、既存のプログラミング環境B121を利用して、国際化対応のプログラムである実行ファイル111を生成することが可能となる。
The
以上、本実施の形態による国際化対応のプログラム作成システムによれば、国際化対応されていないプログラムコードに対して、国際化の修正を加えずに国際化対応のプログラムを作成することができる。また、自動翻訳機能が十分正確なものであれば、途中結果で生成される翻訳ファイルの修正をすることがなく、もしくは修正を最小限に抑えられ、国際化対応のプログラムを迅速に作成し出荷することができる。 As described above, according to the internationalized program creation system according to the present embodiment, it is possible to create an internationalized program without modifying internationalization for a program code that is not internationalized. In addition, if the automatic translation function is sufficiently accurate, the translation file generated as a result in the middle will not be corrected, or the correction can be minimized, and an internationalized program can be quickly created and shipped. can do.
さらに、それぞれのプログラミング言語で定義されている国際化対応ルールに従わなくても、複数のプログラミング言語で構成されているプログラムコードに基づいて国際化対応のプログラムを作成することが可能である。また、自動翻訳された結果を変更する場合も、翻訳ファイルの形式がプログラミング言語ごとに異ならず同一のため、翻訳作業も効率よく行える。複数の自然言語に翻訳する場合に処理を並列化できるため、処理が簡略かつ迅速になる。 Furthermore, it is possible to create an internationalized program based on a program code composed of a plurality of programming languages without following the internationalization rules defined in each programming language. In addition, even when the result of automatic translation is changed, the translation file format is the same for each programming language, so that translation work can be performed efficiently. Since the processing can be parallelized when translated into a plurality of natural languages, the processing becomes simple and quick.
尚、ソースファイルが、部分的に国際化の修正が施されたプログラムコードである場合でも、翻訳ファイル分離処理により国際化の修正が施されたファイルとそうでないファイルとに分離されるため、国際化への対応が可能である。 Even if the source file is a program code that has been partially modified for internationalization, it is separated into a file that has been modified for internationalization and a file that has not been modified by the translation file separation process. It is possible to cope with
本発明は、プログラム作成装置として利用可能である。 The present invention can be used as a program creation device.
101…ソースファイル、102…翻訳ファイル分離処理部、103…ソースコード改、104…翻訳ファイル、105…対応ファイル、106…翻訳エンジン、107…翻訳結果ファイル、108…リソース変換処理部、109…リソースファイル、110…コンパイル/ビルド処理部、111…実行ファイル、120…プログラミング環境A、121…プログラミング環境B、201…翻訳ファイルの1列目、202…翻訳ファイルの2列目、210…翻訳ファイルの1行目、401…識別子。
DESCRIPTION OF
Claims (4)
前記翻訳ファイルを翻訳し、翻訳結果ファイルを生成する自動翻訳ステップと、
前記翻訳結果ファイルと前記対応ファイルとに基づいて、識別子により識別されコンパイル/ビルド処理が可能な形式を有するリソースファイルを生成するリソース変換処理ステップと、
前記リソースファイルと前記ソースファイル改とに基づいてコンパイル/ビルド処理を行うことにより、実行ファイルを作成するコンパイル/ビルド処理ステップと
を有するプログラミング方法。 A unique identifier is assigned to a translation file in which non-internationalized character strings are extracted from a source file that contains programming code that does not comply with internationalization rules, and to non-internationalized character strings. The source file is converted into a source file having a format that can be compiled / built, and the translation file is separated into a corresponding file that associates the translated file with the unique identifier for each character string. A file separation processing step;
An automatic translation step of translating the translation file and generating a translation result file;
Based on the translation result file and the corresponding file, a resource conversion processing step of generating a resource file having a format that is identified by an identifier and can be compiled / built,
A programming method including a compile / build process step of creating an execution file by performing a compile / build process based on the resource file and the source file modification.
前記翻訳ファイルを翻訳し、前記識別子を保持した翻訳結果ファイルを生成する自動翻訳部と、
前記翻訳結果ファイルと前記対応ファイルとに基づいて、識別子により識別されコンパイル/ビルド処理が可能な形式を有するリソースファイルを生成するリソース変換処理部と、
前記リソースファイルと前記ソースファイル改とに基づいてコンパイル/ビルド処理を行うことにより、実行ファイルを作成するコンパイル/ビルド処理部と
を有するプログラミング装置。 A unique identifier is assigned to a translation file in which non-internationalized character strings are extracted from a source file containing programming code that does not comply with internationalization rules, and to non-internationalized character strings. The source file is converted into a source file having a format that can be compiled / built, and a translation file that separates the translation file and the unique identifier for each character string. A file separation processing unit;
An automatic translation unit for translating the translation file and generating a translation result file holding the identifier;
Based on the translation result file and the corresponding file, a resource conversion processing unit that generates a resource file having a format that is identified by an identifier and that can be compiled / built,
A programming apparatus having a compile / build processing unit that creates an execution file by performing compile / build processing based on the resource file and the source file revision.
4. The programming device according to claim 3, wherein the automatic translation unit has a multilingual parallel translation table for translating a translation file into a translation result file based on a plurality of natural languages.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004336594A JP2006146619A (en) | 2004-11-19 | 2004-11-19 | System for creating global program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004336594A JP2006146619A (en) | 2004-11-19 | 2004-11-19 | System for creating global program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2006146619A true JP2006146619A (en) | 2006-06-08 |
Family
ID=36626217
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004336594A Pending JP2006146619A (en) | 2004-11-19 | 2004-11-19 | System for creating global program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2006146619A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008269517A (en) * | 2007-04-25 | 2008-11-06 | Funai Electric Co Ltd | File management method |
JP2014225256A (en) * | 2013-04-26 | 2014-12-04 | キヤノンマーケティングジャパン株式会社 | Program generation device, control method for the device, and program |
JP2015194862A (en) * | 2014-03-31 | 2015-11-05 | 富士通株式会社 | Compiler, compilation method, and compilation device |
CN107133200A (en) * | 2017-04-14 | 2017-09-05 | 深圳市海派通讯科技有限公司 | A kind of android system text string extracting and merging method |
-
2004
- 2004-11-19 JP JP2004336594A patent/JP2006146619A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008269517A (en) * | 2007-04-25 | 2008-11-06 | Funai Electric Co Ltd | File management method |
JP2014225256A (en) * | 2013-04-26 | 2014-12-04 | キヤノンマーケティングジャパン株式会社 | Program generation device, control method for the device, and program |
JP2015194862A (en) * | 2014-03-31 | 2015-11-05 | 富士通株式会社 | Compiler, compilation method, and compilation device |
CN107133200A (en) * | 2017-04-14 | 2017-09-05 | 深圳市海派通讯科技有限公司 | A kind of android system text string extracting and merging method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108399064B (en) | Multilingual entry generation method based on Qt development | |
US20100146491A1 (en) | System for Preparing Software Documentation in Natural Languages | |
US20110179073A1 (en) | Method for Localizing Text in a Software Application | |
JPH1083293A (en) | Error correction compiler | |
CN101216820A (en) | Multi-language translation method and device | |
CN115408088A (en) | Software system language internationalization full-process automation method | |
JP2004220616A (en) | Machine translation system for simultaneously displaying and editing three or more parallel translation screens | |
JP2006146619A (en) | System for creating global program | |
JP2007140845A (en) | Program management method and program transition assistance apparatus | |
CN110554860B (en) | Construction method and code generation method of software project natural language programming interface (NLI) | |
JP2009134445A (en) | Software component extraction support device | |
CN113448591A (en) | Method for quickly creating iOS engineering based on python | |
JPH04286029A (en) | Source program converter | |
CN112486623A (en) | Development method, system and electronic equipment for automatically supporting multiple languages based on interface | |
JP2008293176A (en) | Plant controller | |
US7529658B2 (en) | Method for specifying equivalence of language grammars and automatically translating sentences in one language to sentences in another language in a computer environment | |
JP7158576B1 (en) | How to create a statement | |
JP2006079484A (en) | Source program conversion program for system migration | |
JP2009146196A (en) | Translation support system, translation support method and translation support program | |
JP2002007398A (en) | Method and device for controlling translation and storage medium with translation control program recorded thereon | |
JP5181788B2 (en) | Source program language conversion apparatus, method and program | |
JPH1185536A (en) | Device and method for automatically correcting error of source program | |
JP2005301558A (en) | Method for conversion into multilingual multicode database | |
JP6267971B2 (en) | Source code analysis support device, source code analysis support method | |
CN115373689A (en) | Compiling optimization method, device, equipment and medium based on LLVM |