CN111638930A - Shell-based iOS multi-language script configuration method and system - Google Patents
Shell-based iOS multi-language script configuration method and system Download PDFInfo
- Publication number
- CN111638930A CN111638930A CN202010463703.3A CN202010463703A CN111638930A CN 111638930 A CN111638930 A CN 111638930A CN 202010463703 A CN202010463703 A CN 202010463703A CN 111638930 A CN111638930 A CN 111638930A
- Authority
- CN
- China
- Prior art keywords
- file
- language
- script
- module
- row
- 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.)
- Withdrawn
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
- G06F9/454—Multi-language systems; Localisation; Internationalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/71—Version control; Configuration management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Human Computer Interaction (AREA)
- Stored Programmes (AREA)
- Machine Translation (AREA)
Abstract
The invention discloses a shell-based iOS multi-language script configuration method and system, which can realize the automation from the display of translated file contents on a table to the iOS configuration by negotiating and unifying the files in an excel table, do not need manual one-by-one copy operation, uniformly maintain an excel table file, achieve simple addition, deletion and modification, improve the efficiency, shorten the time wasted in the configuration stage in practice and save the time cost.
Description
Technical Field
The invention relates to the technical field of application programs, in particular to a shell-based iOS multi-language script configuration method and system.
Background
At present, in the development process of an iOS application APP, application software in different countries is released, different languages need to be configured, a document needing to be displayed in an application program is locally translated aiming at different countries, and then the document is filled in a form or a document, and through research personnel, each sentence is copied and pasted into a developed engineering project one by adopting a manual operation mode. Such a configuration process requires a lot of time and a lot of mechanized repetitive operations, and if errors such as sequence and content occur in the copying process, other subsequent contents may occur, and in the inspection aspect, manual restart of sentence-by-sentence checking, inspecting and modifying is required. If a new national language file needs to be supported or part of the content needs to be modified or deleted due to subsequent language word banks, version updating and the like or other reasons, all the multilingual files need to be manually retrieved and then checked for modification, so that the efficiency is extremely low. In the existing technical scheme, only the management and organization mode of the multi-language files of the project is solved, and the problem of automation from the files to the project configuration is not directly solved.
Disclosure of Invention
In order to solve the above problems, the present invention provides a shell-based iOS multi-language script configuration method, so as to achieve the above disadvantages, the method comprising:
step S1: acquiring a resource file and reading script directory information;
step S2: performing multi-language configuration on data of excel forms and script information in the script directory;
step S3: and judging whether a multilingual excel table needing to be processed continuously exists, if so, repeating the step S2, and if not, deleting the temporary file temp.
Further, the step S2 includes the following sub-steps:
step S21: acquiring current language setting information and the multi-language resource file;
step S22: converting the excel table into a csv format file through an open source tool xlsx2 cvs;
step S23: analyzing the csv file, acquiring the total column number of the excel table of the table, and circularly reading the content of each column from the third column;
step S24: checking whether a file of the language code exists under an iOS project Localization directory or not by reading each line of the code of the national language, if so, continuing to analyze, and if not, continuing to operate the next step;
step S25: circulating the current processing column, corresponding to the contents of all the rows, filling the first row and the row with empty contents into the ". strings" file of the corresponding language in the form of "// contents", and filling the first row and the row with non-empty contents into the content in the form of "key"; "form is filled into". strings "file;
step S26: and judging whether the content has line feed display or not, if so, changing the carriage return in the table into '\ n', agreeing to a uniform format, and replacing the script.
The invention realizes complete automation by analyzing excel table content, matching codes of corresponding countries and belonging keys and then automatically inputting the codes into corresponding files according to a specific format, greatly shortens the time for configuring multiple languages in development based on the realization of shell scripts, and reduces errors caused by manual copying without manual participation. The content quantity in each multi-language file and the file quantity of the application software are in positive correlation, and the quantity of the languages which can be supported by the application software is multiplied. If there are 100 displayed documents in an application software, the national language to be supported is 10 national versions, the time required for manually copying a document of a national language into a corresponding multi-language file is 2 seconds, and the time for switching interfaces and searching the corresponding document in the copying process is omitted, the whole process needs 100 × 10 × 2s ═ 2000s ≈ 33 minutes, namely about half an hour; if the configuration method based on the shell script is used, the processing time of 1000 documents can be finished in 1s and the like.
The invention also discloses a system for configuring the iOS multi-language script based on the shell, which comprises the following steps:
a reading module: acquiring a resource file and reading script directory information;
a configuration module: performing multi-language configuration on data of excel forms and script information in the script directory;
a judging module: and judging whether a multilingual excel table needing to be processed continuously exists, if so, repeating the step S2, and if not, deleting the temporary file temp.
Further, the configuration module includes the following sub-modules:
the resource information reading module: acquiring current language setting information and the multi-language resource file;
a conversion module: converting the excel table into a csv format file through an open source tool xlsx2 cvs;
an analysis module: and analyzing the csv file to obtain the total column number of the excel table of the table. And reading the content of each column circularly from the third column;
a checking and verifying module: checking whether a file of the language code exists under an iOS project Localization directory or not by reading each line of the code of the national language, if so, continuing to analyze, and if not, continuing to operate the next step;
a circulation module: circulating the current processing column, corresponding to the contents of all the rows, filling the first row and the row with empty contents into the ". strings" file of the corresponding language in the form of "// contents", and filling the first row and the row with non-empty contents into the content in the form of "key"; "form is filled into". strings "file;
and a replacement module: and judging whether the content has line feed display or not, if so, changing the carriage return in the table into '\ n', agreeing to a uniform format, and replacing the script.
According to the multilingual configuration method and system disclosed by the invention, the automation from the display of the translated file contents on the table to the iOS configuration is realized by negotiating and unifying the files in the excel table, manual one-by-one copying operation is not needed, one excel table file is maintained in a unified way, the simple addition, deletion and modification can be realized, the efficiency is improved, the time wasted in the configuration stage in practice is shortened, and the time cost is saved.
Drawings
FIG. 1 is a flow chart illustrating a method for configuring an iOS multi-language script based on shell according to the present invention;
FIG. 2 is a schematic diagram of a shell-based iOS multi-language script system of the present invention;
FIG. 3 is a diagram illustrating an iOS project, strings, multi-language file code, in accordance with an embodiment of the present invention;
FIG. 4 is a diagram illustrating a table format of an excel file set in an embodiment of the present invention;
FIG. 5 is a flow diagram of a configuration module of the present invention;
Detailed Description
Referring to fig. 1, the present invention provides a shell-based iOS multi-language script configuration method, which comprises:
step S1: acquiring a resource file and reading script directory information;
step S2: carrying out multi-language configuration on excel tables in the script directory and data of script information;
step S3: and judging whether a multilingual excel table needing to be processed continuously exists, if so, repeating the step S2, and if not, deleting the temporary file temp.
Further, the step S2 includes the following sub-steps:
step S21: acquiring current language setting information and the multi-language resource file;
step S22: converting the excel table into a csv format file through an open source tool xlsx2 cvs;
because the excel table cannot be directly analyzed under the shell script and converted into the csv format file, the excel table needs to be firstly converted into the tmep.csv file, and only the next analysis is needed;
step S23: analyzing the csv file, acquiring the total column number of the excel table of the table, and circularly reading the content of each column from the third column;
as shown in fig. 4, the key corresponding to the first column, the second column is the description of the document, and the contents after the third column are the real multi-language contents, so that the contents of each column are read circularly from the third column;
step S24:
checking whether a file of the language code exists under an iOS project Localization directory or not by reading each line of the code of the national language, if so, continuing to analyze, and if not, continuing to operate the next step;
step S25: circulating the current processing column, corresponding to the contents of all the rows, filling the first row and the row with empty contents into the ". strings" file of the corresponding language in the form of "// contents", and filling the first row and the row with non-empty contents into the content in the form of "key"; "form is filled into". strings "file; as shown in FIG. 3, "// zh-hans; "and"// module 1 ", etc., the content of the row corresponding to the first column of the table is not empty, and the content is represented by" key "; "form is filled into". strings "file," key2 ═ case 1; "and the like;
step S26: judging whether the content has line feed display or not, if so, changing the carriage return in the form into '\ n', wherein the protocol is a uniform format, and replacing the script; the symbol of @ # is used as a default to search the full text, and the defined line feed symbol is replaced with "\ n" to be displayed.
As shown in fig. 2, a schematic diagram of a shell-based configuration iOS multi-language script system of the present invention is shown,
a reading module: acquiring a resource file and reading script directory information;
a configuration module: carrying out multi-language configuration on excel tables in the script directory and data of script information;
a judging module: and judging whether a multilingual excel table needing to be processed continuously exists, if so, repeating the step S2, and if not, deleting the temporary file temp.
Further, the configuration module includes the following sub-modules:
the resource information reading module: acquiring current language setting information and the multi-language resource file;
a conversion module: converting the excel table into a csv format file through an open source tool xlsx2 cvs;
because the excel table cannot be directly analyzed under the shell script and converted into the csv format file, the excel table needs to be firstly converted into the tmep.csv file, and only the next analysis is needed;
an analysis module: analyzing the csv file, acquiring the total column number of the excel table of the table, and circularly reading the content of each column from the third column;
as shown in fig. 4, the key corresponding to the first column, the second column is the description of the document, and the contents after the third column are the real multi-language contents, so that the contents of each column are read circularly from the third column;
a checking and verifying module: checking whether a file of the language code exists under an iOS project Localization directory or not by reading each line of the code of the national language, if so, continuing to analyze, and if not, continuing to operate the next step;
a circulation module: circulating the current processing column, corresponding to the contents of all the rows, filling the first row and the row with empty contents into the ". strings" file of the corresponding language in the form of "// contents", and filling the first row and the row with non-empty contents into the content in the form of "key"; "form is filled into". strings "file; as shown in FIG. 3, "// zh-hans; "and"// module 1 ", etc., the content of the row corresponding to the first column of the table is not empty, and the content is represented by" key "; "form is filled into". strings "file," key2 ═ case 1; "and the like;
and a replacement module: judging whether the content has line feed display or not, if so, changing the carriage return in the form into '\ n', wherein the protocol is a uniform format, and replacing the script; the symbol of @ # is used as a default to search the full text, and the defined line feed symbol is replaced with "\ n" to be displayed.
The invention realizes complete automation by analyzing excel table content, matching codes of corresponding countries and belonging keys and then automatically inputting the codes into corresponding files according to a specific format, greatly shortens the time for configuring multiple languages in development based on the realization of shell scripts, and reduces errors caused by manual copying without manual participation. The content quantity in each multi-language file and the file quantity of the application software are in positive correlation, and the quantity of the languages which can be supported by the application software is multiplied. If there are 100 displayed documents in an application software, the national language to be supported is 10 national versions, the time required for manually copying a document of a national language into a corresponding multi-language file is 2 seconds, and the time for switching interfaces and searching the corresponding document in the copying process is omitted, the whole process needs 100 × 10 × 2s ═ 2000s ≈ 33 minutes, namely about half an hour; if the configuration method based on the shell script is used, the processing time of 1000 documents can be finished in 1s and the like.
The present invention is not limited to the above-described preferred embodiments, but various modifications and changes may be made by those skilled in the art. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.
Claims (4)
1. The method for configuring the iOS multi-language script based on the shell comprises the following steps:
step S1: acquiring a resource file and reading script directory information;
step S2: performing multi-language configuration on data of excel forms and script information in the script directory;
step S3: and judging whether a multilingual excel table needing to be processed continuously exists, if so, repeating the step S2, and if not, deleting the temporary file temp.
2. The shell-based configuration iOS multilingual script method of claim 1, wherein said step S2 comprises the sub-steps of:
step S21: acquiring current language setting information and the multi-language resource file;
step S22: converting the excel table into a csv format file through an open source tool xlsx2 cvs;
step S23: analyzing the csv file, acquiring the total column number of the excel table of the table, and circularly reading the content of each column from the third column;
step S24: checking whether a file of the language code exists under an iOS project Localization directory or not by reading each line of the code of the national language, if so, continuing to analyze, and if not, continuing to operate the next step;
step S25: circulating the current processing column, corresponding to the contents of all the rows, filling the first row and the row with empty contents into the ". strings" file of the corresponding language in the form of "// contents", and filling the first row and the row with non-empty contents into the content in the form of "key"; "form is filled into". strings "file;
step S26: and judging whether the content has line feed display or not, if so, changing the carriage return in the table into '\ n', agreeing to a uniform format, and replacing the script.
3. Configuring an iOS multi-language script system based on shell, the system comprising:
a reading module: acquiring a resource file and reading script directory information;
a configuration module: performing multi-language configuration on data of excel forms and script information in the script directory;
a judging module: and judging whether a multilingual excel table needing to be processed continuously exists, if so, repeating the step S2, and if not, deleting the temporary file temp.
4. The shell-based configuration iOS multilingual script system of claim 3, wherein said configuration module comprises the following sub-modules:
the resource information reading module: acquiring current language setting information and the multi-language resource file;
a conversion module: converting the excel table into a csv format file through an open source tool xlsx2 cvs;
an analysis module: and analyzing the csv file to obtain the total column number of the excel table of the table. And reading the content of each column circularly from the third column;
a checking and verifying module: checking whether a file of the language code exists under an iOS project Localization directory or not by reading each line of the code of the national language, if so, continuing to analyze, and if not, continuing to operate the next step;
a circulation module: circulating the current processing column, corresponding to the contents of all the rows, filling the first row and the row with empty contents into the ". strings" file of the corresponding language in the form of "// contents", and filling the first row and the row with non-empty contents into the content in the form of "key"; "form is filled into". strings "file;
and a replacement module: and judging whether the content has line feed display or not, if so, changing the carriage return in the table into '\ n', agreeing to a uniform format, and replacing the script.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010463703.3A CN111638930A (en) | 2020-05-27 | 2020-05-27 | Shell-based iOS multi-language script configuration method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010463703.3A CN111638930A (en) | 2020-05-27 | 2020-05-27 | Shell-based iOS multi-language script configuration method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111638930A true CN111638930A (en) | 2020-09-08 |
Family
ID=72329385
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010463703.3A Withdrawn CN111638930A (en) | 2020-05-27 | 2020-05-27 | Shell-based iOS multi-language script configuration method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111638930A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113011143A (en) * | 2021-03-11 | 2021-06-22 | 南京信息职业技术学院 | Intelligent Word document filling system and method based on RPA |
CN113011142A (en) * | 2021-03-11 | 2021-06-22 | 南京信息职业技术学院 | Excel document intelligent filling system and method based on RPA |
-
2020
- 2020-05-27 CN CN202010463703.3A patent/CN111638930A/en not_active Withdrawn
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113011143A (en) * | 2021-03-11 | 2021-06-22 | 南京信息职业技术学院 | Intelligent Word document filling system and method based on RPA |
CN113011142A (en) * | 2021-03-11 | 2021-06-22 | 南京信息职业技术学院 | Excel document intelligent filling system and method based on RPA |
CN113011142B (en) * | 2021-03-11 | 2023-06-27 | 南京信息职业技术学院 | Intelligent Excel document filling system and method based on RPA |
CN113011143B (en) * | 2021-03-11 | 2023-06-27 | 南京信息职业技术学院 | Word document intelligent reporting system and method based on RPA |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104317788B (en) | The multi-lingual interpretation methods of Android and device | |
US7571092B1 (en) | Method and apparatus for on-demand localization of files | |
CN109933752B (en) | Method and device for exporting electronic document | |
US7577946B2 (en) | Program product, method, and system for testing consistency of machine code files and source files | |
US7636656B1 (en) | Method and apparatus for synthesizing multiple localizable formats into a canonical format | |
CN102722479B (en) | A kind of method of implementation language translation and device | |
CN109408528B (en) | Database script generation method and device, calculation device and storage medium | |
US20040268257A1 (en) | Method, apparatus, and system for providing multi-language character strings within a computer | |
CN105793818A (en) | Source code translation | |
CN101427243A (en) | Localising unstructured resources | |
CN110334326B (en) | A kind of method and system for identifying recipe file and being converted into XML file | |
CN101667118A (en) | Method and device for multi-language version development and replacement | |
CN111638930A (en) | Shell-based iOS multi-language script configuration method and system | |
CN114328276B (en) | Test case generation method and device, and test case display method and device | |
Tufano et al. | Methods2Test: A dataset of focal methods mapped to test cases | |
CN109947711B (en) | Automatic multi-language file management method in IOS project development process | |
CN115408088A (en) | Software system language internationalization full-process automation method | |
CN109117173B (en) | Configuration file management method based on project version development | |
CN106033338A (en) | Method and device for importing and analyzing source code based on FOG data | |
KR20210040545A (en) | Multilingual manual authoring apparatus based on XML and method thereof | |
CN117454881B (en) | Website dynamic tag analysis method based on static page | |
CN112819419B (en) | Android application international language management method and system based on Git | |
KR100656559B1 (en) | Program Automatic Generating Tools | |
CN116661794B (en) | Hardware description language semantic conversion method and device | |
JP2000347910A (en) | Database processing system, accessing method, sql converting method and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20200908 |