Language switching method and device of software, electronic equipment and storage medium

Through the design of language template files and XML format processing, the problem of low efficiency of software language package switching is solved, simplifying language switching and improving internationalization capabilities. Users can easily switch languages ​​without complicated operations.

CN118779043APending Publication Date: 2024-10-15KYLAND TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410748109.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

The existing software language pack switching method is not efficient enough. Users need to manually find the download address and process the language pack, which affects the user experience. In particular, online installation is affected by the network and does not support all languages, and offline installation requires technical knowledge.

Method used

Design the language template file, extract and fill the language data in the software language file into the template, use unique identifiers to modify and replace, support custom modifications, simplify processing through XML format, and package it into a language plug-in that can be recognized by the software to achieve dynamic Language switching.

Benefits of technology

It achieves simplification and efficiency improvement of language switching, supports custom modification of languages, and enhances the internationalization and localization capabilities of the software. There is no need to recompile or install, and users can easily download and install language plug-ins.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779043A_ABST
    Figure CN118779043A_ABST
Patent Text Reader

Abstract

The invention discloses a software language switching method and device, electronic equipment and a storage medium, and belongs to the technical field of computer software. The method comprises the following steps: filling first language data in a language file used by software into a preset language template file; each language text of the first language data of the language template file corresponds to a unique identifier; modifying the language text of the first language data in the language template file to obtain second language data; and writing the second language data into the language file according to the unique identifier so as to enable the second language data to replace the first language data in the language file. According to the embodiment of the invention, the language data of the software is written into the language template, the language data is modified in the language template, and the modified language data is rewritten into the original language file, so that the accuracy of the replacement process is improved, the simplification of the language switching process is realized, the user-defined modification of the language is supported, and the user experience is improved. And the switching efficiency of the software language is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer software technology, and in particular, relates to a software language switching method, device, electronic device and storage medium. Background Art

[0002] In the field of global software development, issues of software localization and multi-language support are common challenges that many software products encounter during the globalization process.

[0003] Currently, most software products provide the language pack switching function by online downloading, which allows users to visit the official website or online resource library of the software through the Internet to download and install additional language packs.

[0004] However, the online installation process requires users to find the download address of the language pack and the corresponding version by themselves, which makes the current method of switching language packs inefficient and affects the user experience. Summary of the invention

[0005] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a software language switching method, device, electronic device and storage medium to support custom modification of the language and improve the efficiency of software language switching.

[0006] In a first aspect, the present application provides a method for switching a language of a software, comprising:

[0007] Filling the first language data in the language file used by the software into a preset language template file; wherein each language text of the first language data in the language template file corresponds to a unique identifier;

[0008] Modifying the language text of the first language data in the language template file to obtain second language data;

[0009] The second language data is written into the language file according to the unique identifier, so that the second language data replaces the first language data in the language file.

[0010] According to the language switching method of the software of the present application, the first language data in the language file used by the software is filled into a preset language template file; wherein each language text of the first language data in the language template file corresponds to a unique identifier; the language text of the first language data is modified in the language template file to obtain the second language data; the second language data is written into the language file according to the unique identifier, so that the second language data replaces the first language data in the language file. The embodiment of the present application allows rapid positioning of each language text through a unique identifier through the design of the language template file, and the language text of the first language data can be modified as needed to generate the second language data, and then the modified second language data is accurately written into the original language file using the unique identifier, thereby ensuring the accuracy of the replacement process, thereby simplifying the language switching process, and supporting custom modification of the language, improving the efficiency of software language switching, and enhancing the internationalization and localization capabilities of the software.

[0011] According to an embodiment of the present application, filling the first language data in the language file used by the software into the preset language template file includes:

[0012] extracting first language data from the language file;

[0013] The first language data is filled into the first area and the second area of ​​the language template file respectively; wherein the language texts with the same unique identifier in the first area and the second area are in adjacent positions.

[0014] In this embodiment, by placing language texts with the same unique identifier in the first area and the second area in adjacent positions, the readability and usability of the template are enhanced, so that users can quickly identify and correspond to various parts of the language text during the process of customizing the language text, thereby reducing errors and omissions. The user does not need to have rich professional knowledge or perform complicated operations, thereby improving the efficiency of language text modification.

[0015] According to an embodiment of the present application, the language template file is a file in XML format, and the language texts with the same unique identifier in the first area and the second area are in the same entry.

[0016] In this embodiment, XML is a markup language, and its structured characteristics make the language template easy to parse and process, and easy to read and generate by machines. In the XML file, the language texts with the same unique identifier are placed in the same entry, and the unique identifier is used to associate the language texts in the first area and the second area. This mapping method simplifies the search and replace process and improves the efficiency of the automated tool in processing the language file.

[0017] According to an embodiment of the present application, modifying the language text of the first language data in the language template file to obtain the second language data includes:

[0018] Determining the target language text that needs to be modified in the first area;

[0019] The language text in the second region adjacent to the target language text is modified, and the language text in the second region is determined as second language data.

[0020] In this embodiment, by determining the target language text to be modified in the first area and modifying the language text in the adjacent position in the second area accordingly, the consistency of the content of the language text with the same unique identifier in the two areas is improved. In addition, since the language text with the same unique identifier in the first area and the second area is in adjacent positions, the modification operation can be more intuitive and convenient.

[0021] According to an embodiment of the present application, writing the second language data into the language file according to the unique identifier so that the second language data replaces the first language data in the language file includes:

[0022] extracting each language text in the second region to obtain second language data;

[0023] The corresponding language text in the language file is matched with the unique identifier as a key, and the language text with the same unique identifier in the second language data replaces the corresponding language text in the language file.

[0024] In this embodiment, the second language data is obtained by extracting each language text in the second area, and then the corresponding language text in the language file is matched using the unique identifier as a matching basis. There is no need to manually check and replace each entry, which reduces erroneous replacements caused by similar or repeated text content and improves the accuracy of the replacement process.

[0025] According to one embodiment of the present application, the method further includes:

[0026] The replaced language files are packaged into a language plug-in recognizable by the software.

[0027] In this embodiment, a convenient and efficient language update and distribution mechanism is provided by packaging the replaced language files into a language plug-in recognizable by the software. In the form of a plug-in, the software can dynamically load or switch language packages without recompiling or reinstalling the entire application, thereby simplifying the software's multi-language support process and allowing users to easily download and install corresponding language plug-ins according to their language preferences or needs.

[0028] According to an embodiment of the present application, the software includes eclipse, and the language file is a properties file.

[0029] In a second aspect, the present application provides a software language switching device, comprising:

[0030] A filling module, used to fill the first language data in the language file used by the software into a preset language template file; wherein each language text of the first language data in the language template file corresponds to a unique identifier;

[0031] A modification module, used for modifying the language text of the first language data in the language template file to obtain second language data;

[0032] A replacement module is used to write the second language data into the language file according to the unique identifier, so that the second language data replaces the first language data in the language file.

[0033] According to the language switching device of the software of the present application, the first language data in the language file used by the software is filled into a preset language template file; wherein each language text of the first language data in the language template file corresponds to a unique identifier; the language text of the first language data is modified in the language template file to obtain the second language data; the second language data is written into the language file according to the unique identifier, so that the second language data replaces the first language data in the language file. The embodiment of the present application allows rapid positioning of each language text through a unique identifier through the design of the language template file, and the language text of the first language data can be modified as needed to generate the second language data, and then the modified second language data is accurately written into the original language file using the unique identifier, thereby ensuring the accuracy of the replacement process, thereby simplifying the language switching process, and supporting custom modification of the language, improving the efficiency of software language switching, and enhancing the internationalization and localization capabilities of the software.

[0034] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the software language switching method as described in the first aspect above is implemented.

[0035] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the software language switching method as described in the first aspect above.

[0036] In a fifth aspect, the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the language switching method of the software as described in the first aspect above.

[0037] In a sixth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the software language switching method as described in the first aspect above.

[0038] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:

[0039] According to the language switching method of the software of the present application, the first language data in the language file used by the software is filled into a preset language template file; wherein each language text of the first language data in the language template file corresponds to a unique identifier; the language text of the first language data is modified in the language template file to obtain the second language data; the second language data is written into the language file according to the unique identifier, so that the second language data replaces the first language data in the language file. The embodiment of the present application allows rapid positioning of each language text through a unique identifier through the design of the language template file, and the language text of the first language data can be modified as needed to generate the second language data, and then the modified second language data is accurately written into the original language file using the unique identifier, thereby ensuring the accuracy of the replacement process, thereby simplifying the language switching process, and supporting custom modification of the language, improving the efficiency of software language switching, and enhancing the internationalization and localization capabilities of the software.

[0040] Furthermore, in some embodiments, by placing language texts with the same unique identifier in the first area and the second area in adjacent positions, the readability and usability of the template are enhanced, so that users can quickly identify and correspond to various parts of the language text during the process of customizing the language text, thereby reducing errors and omissions, eliminating the need for users to have rich professional knowledge and requiring complex operations, thereby improving the efficiency of language text modification.

[0041] Furthermore, in some embodiments, XML is a markup language, and its structured characteristics make language templates easy to parse and process, and easy to read and generate by machines. In the XML file, language texts with the same unique identifier are placed in the same entry, and the unique identifier is used to associate the language texts in the first area and the second area. This mapping method simplifies the search and replace process and improves the efficiency of automatic tools in processing language files.

[0042] Furthermore, in some embodiments, by determining the target language text to be modified in the first area and modifying the language text in the adjacent position in the second area accordingly, the consistency of the content of the language text with the same unique identifier in the two areas is improved. In addition, since the language text with the same unique identifier in the first area and the second area is in adjacent positions, the modification operation can be more intuitive and convenient.

[0043] Furthermore, in some embodiments, the second language data is obtained by extracting each language text in the second area, and then using the unique identifier as a matching basis to match the corresponding language text in the language file, without the need to manually check and replace each entry, thereby reducing erroneous replacements caused by similar or repeated text content and improving the accuracy of the replacement process.

[0044] Furthermore, in some embodiments, a convenient and efficient language update and distribution mechanism is provided by packaging the replaced language files into a language plug-in recognizable by the software. In the form of a plug-in, the software can dynamically load or switch language packs without recompiling or reinstalling the entire application, thereby simplifying the software's multi-language support process and allowing users to easily download and install corresponding language plug-ins according to their language preferences or needs.

[0045] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0047] Figure 1 It is a flowchart of a method for switching the language of software provided in an embodiment of the present application;

[0048] Figure 2 is an example of a language file provided in an embodiment of the present application;

[0049] Figure 3 is an example of a language template file provided in an embodiment of the present application;

[0050] Figure 4 It is a structural diagram of a language switching device for software provided in an embodiment of the present application;

[0051] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0053] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0054] With the continuous advancement of globalization, the user groups of software products are becoming increasingly diversified. In order to meet the needs of users in different countries and regions, software developers have launched multilingual support functions. The language pack switching function allows users to easily change the language display of the software interface and documents according to their language preferences, thereby improving the user experience. Whether it is an individual user, a corporate team or an educational institution, the language pack switching function has greatly enhanced the usability and popularity of the software. For example, on the collaboration platform of a multinational company, language pack switching can ensure that employees with different language backgrounds can use the software to communicate and work without obstacles.

[0055] At present, most software products use built-in or online download methods to provide language pack switching functions. Built-in language packs are usually included when the software is installed, and users can directly select and switch to the desired language environment through the software settings menu. The online download method allows users to access the official website or online resource library of the software through the Internet to download and install additional language packs. Some software also provides the function of automatically detecting the user's system language settings and automatically switching language packs according to the user's geographical location and preferences. For example, for Eclipse, Eclipse supports multi-language environments, allowing users to switch language packs according to personal preferences or team needs to provide a more friendly and intuitive development experience. There are two main methods for switching languages ​​in Eclipse, one is online installation and the other is offline installation. Among them, online installation: you need to find the download address of the language pack officially specified by eclipse, use the official InstallNew Software function of eclipse, paste the language pack download address, select the language pack to be installed and click Install, eclipse will download the officially specified language pack plug-in and restart to achieve the purpose of switching languages. Offline installation: Users need to search for the required language pack on the Eclipse official website, download the language plug-in through the browser, copy it to the plug-in directory specified by Eclipse, and modify the configuration file to specify the startup parameters of Eclipse to achieve the purpose of switching languages.

[0056] Although the existing language pack switching method meets user needs to a certain extent, there are still some problems. For example, the online installation process requires users to find the download address and corresponding version of the language pack by themselves, and the online installation method will also be affected by the network. The built-in language pack may not support all the languages ​​required by users, which limits the multi-language coverage of the software. The offline installation method requires users to have certain technical knowledge, which makes it difficult for non-technical users or beginners to use. For users who need to switch language environments frequently, the current method of switching language packs is not efficient enough, which affects the user experience.

[0057] The present application considers that if a language template file can be designed to extract the language data in the language file of the software, and the language template file supports customized modification of the language data, and then the modified language data replaces the language data in the language file, it is expected to solve the problem of inefficient language pack switching of software in the prior art.

[0058] In conjunction with the accompanying drawings, the software language switching method, device, electronic device and storage medium provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.

[0059] The software language switching method may be applied to a terminal, and may be specifically executed by hardware or software in the terminal.

[0060] The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that in some embodiments, the terminal may not be a portable communication device, but a desktop computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).

[0061] In the following various embodiments, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, a mouse and a joystick.

[0062] The language switching method for software provided in the embodiments of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the language switching method for the software. The electronic devices mentioned in the embodiments of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, and wearable devices. The language switching method for software provided in the embodiments of the present application is described below using an electronic device as an example of the execution subject.

[0063] like Figure 1 As shown, the language switching method of the software includes: step 110, step 120 and step 130.

[0064] Step 110: Fill the first language data in the language file used by the software into a preset language template file; wherein each language text of the first language data in the language template file corresponds to a unique identifier.

[0065] In an embodiment of the present application, the software may be software that supports multilingual functions and supports language pack switching so that the software interface and documents are displayed in the language required by the user. Language files are files containing software interface text, prompt information, etc. These files are usually classified by language, such as English, Chinese, Spanish, etc. The software can load the language file corresponding to the selected language so that the text of the software's interface elements, such as buttons, menus, dialog boxes, etc., are displayed in the corresponding language. For example, if the software is eclipse, the corresponding language file is a properties file; if the software is Xcode, the corresponding language file is a strings file; if the software is Drupal or Joomla, the corresponding language file is an ini file, and so on. Different software may have the same or different corresponding language files, which are determined based on the method used in the software development process.

[0066] The language file may include language data, which can be different types of languages. For example, the language data can be English, Chinese, German, etc. Usually, a language file includes one type of language data. The language data is composed of multiple language texts. For example, if the language data is Chinese, these language texts can be "Hello", "Menu", "Do you confirm to exit?", "Do you confirm to delete?", and so on. Of course, if the language data is English or French, the language texts are the corresponding English or French language texts.

[0067] The language template file is a pre-set file. In the language template file, the position and format of the text are defined, and each text item will have a unique identifier corresponding to it.

[0068] In the embodiment of the present application, first, the type of the software can be identified, and then according to the type of the software, the type of the language file of the software is determined. The corresponding language file is found by traversing in the installation folder of the software according to the type of the language file. Then, the language data in the language file is extracted, and according to the format defined in the language template file, each language text in the language data is input into the language template file in the format of <id - text>. Here, id can represent the unique identifier of the language text.

[0069] Step 120: Modify the language text of the first language data in the language template file to obtain the second language data.

[0070] In the embodiment of the present application, extracting the first language data into the language template file can facilitate the modification of the language text of the first language data, making the modification or translation of the language text of the first language data more efficient and convenient.

[0071] For example, when the first language data is English, the English language text can be converted into other languages, such as Chinese, German, etc., to meet the needs of users in different regions. Of course, since the first language data in the language file may be provided by the software manufacturer, sometimes it may also be because the translator does not come from the native cultural background of the target language, resulting in the translation text not being authentic enough or not conforming to the local habits. Therefore, after extracting the first language data into the language template file, the language text of the first language data can be adjusted according to the culture and language habits of local users. For example, the language text "Do you confirm to exit?" can be modified to "Are you sure you want to exit?", and "Click here to continue" can be modified to "Click here to proceed", etc. Traverse each language text of the first language data in the language template file to find the language text that needs to be modified. After the modification is completed, these language texts can be used as the second language data.

[0072] In some embodiments, the modification method for the language text in the language template file can be to pre-set replacement words, such as replacing "you" with "you", replacing "here" with "here", etc., and if the word "you" is detected in the language text during the traversal of the language text in the language template file, "you" can be modified to "you", and if "here" is detected in the language text, "here" can be modified to "here", and the traversal is completed, and the modification of the language text in the language template file is completed to obtain the second language data. The modification method for the language text in the language template file can also be to provide a visual page, display the language text in the language template file on the page, and the user operates on the page and customizes the modification. The page can receive the user's modification operation on the language text. After the user triggers the operation instruction of the modification end, it means that the modification is completed and the second language data is obtained. Of course, the modification method for the language text in the language template file can also be any other method, and the embodiments of the present application are not limited to this.

[0073] Step 130: Write the second language data into the language file according to the unique identifier, so that the second language data replaces the first language data in the language file.

[0074] In the embodiment of the present application, after modifying the language text in the language template file, the second language data is obtained. If the language switching is to be implemented in the software, the language text of the second language data needs to be written into the language file.

[0075] Specifically, a language template file may include multiple language texts. If these language texts are to be written into a language file, these language texts need to be identified and associated. For example, after the language text "Do you confirm to exit?" is modified to "Do you confirm to exit?", the language text "Do you confirm to exit?" is to be written into the language file, and this language text overwrites the original language text "Do you confirm to exit?" in the language file. It is necessary to find the direct association relationship between the two language texts. In an embodiment of the present application, the association relationship between the two language texts can be determined by a unique identifier. For example, in the language template file, the unique identifier of the language text "Do you confirm to exit?" is Name1. After the language text is modified to the language text "Do you confirm to exit?", this unique identifier Name1 is also the unique identifier of the corresponding language text "Do you confirm to exit?". Therefore, in the process of writing the second language data into the language file, the language text corresponding to the unique identifier in the language file can be found according to the unique identifier of the language text to be written, and then the write operation can be performed. For example, the writing process of the language text "Are you sure to exit?" may include: finding the language text "Are you sure to exit?" corresponding to the unique identifier Name1 in the language file according to the unique identifier Name1, and then writing the language text "Are you sure to exit?" into the corresponding position of the language text "Are you sure to exit?" in the language file to replace the language text "Are you sure to exit?".

[0076] According to the language switching method of the software of the present application, the first language data in the language file used by the software is filled into a preset language template file; wherein each language text of the first language data of the language template file corresponds to a unique identifier; the language text of the first language data is modified in the language template file to obtain the second language data; the second language data is written into the language file according to the unique identifier, so that the second language data replaces the first language data in the language file. The embodiment of the present application allows rapid positioning of each language text through a unique identifier through the design of the language template file, and the language text of the first language data can be modified as needed to generate the second language data, and then the modified second language data is accurately written into the original language file using the unique identifier, thereby ensuring the accuracy of the replacement process, thereby simplifying the language switching process, and supporting custom modification of the language, improving the efficiency of software language switching, and enhancing the internationalization and localization capabilities of the software.

[0077] In some embodiments, filling the first language data in the language file used by the software into the preset language template file includes:

[0078] Extracting first language data from language files;

[0079] The first language data is filled into the first area and the second area of ​​the language template file respectively; wherein the language texts with the same unique identifier in the first area and the second area are in adjacent positions.

[0080] In this embodiment, the language file of the software can be found first. For different software, the language file may be different. For example, the language file can be a properties file, an XML file or a file in any other format, which stores the language data of the software. For example, for the software eclipse, the language package of eclipse can be decompressed to obtain the properties file.

[0081] In a language file, language data includes multiple language texts. Each text message is usually associated with a key, which is used as a unique identifier to accurately locate and reference the text in the software. That is, in a language file, the language text and the unique identifier can be stored in a key-value pair, with the language text as the value and the unique identifier as the key. Figure 2 As shown in the figure, the properties file can include language text and unique identifier. The language text is on the right side of the equal sign, and the unique identifier is on the right side of the equal sign.

[0082] The process of extracting the first language data in the language file may include reading these key-value pairs and copying or exporting them to a preset language template file for subsequent processing.

[0083] In this embodiment, the language template file can be a structured file, which is divided into a first area and a second area for storing first language data. The first language data can be divided into two parts and filled into the first area and the second area respectively, wherein the two parts of the first language data are complete first language data, or the first language data is copied again to obtain two identical first language data, and then one part of the first language data is filled into the first area and the other part of the first language data is filled into the second area. The specific filling process begins with arranging the extracted first language data according to the format requirements of the template. Each key-value pair is written to the corresponding position of the first area according to its unique identifier. Then, the data in the first area is copied or mapped to the corresponding position of the second area according to the design of the template, ensuring that the language texts with the same unique identifier in the first area and the second area are in adjacent positions. For example, if a key-value pair in the first area is located at the top of the template, the corresponding key-value pair in the second area should also follow it, or the corresponding key-value pair in the second area is in the same row as the key-value pair in the first area.

[0084] In this embodiment, by placing the language texts with the same unique identifier in the first region and the second region adjacent to each other, the readability and usability of the template are enhanced, enabling the user to quickly identify and correspond to each part of the language text during the process of customizing and modifying the language text, thereby reducing errors and omissions. Without the need for the user to have extensive professional knowledge and complex operations, the efficiency of modifying the language text is improved.

[0085] In some embodiments, the language template file is an XML-formatted file, and the language texts with the same unique identifier in the first region and the second region are in the same entry.

[0086] In this embodiment, the language template file can be an XML-formatted file. As Figure 3 shown, the language text and the unique identifier id can be stored in the language template file in the format of <id-text>. Among them, the first region can be the region where raw is located, and the second region is the region where msg is located. The language texts with the same unique identifier id are in the same entry item. Of course, Figure 3 only gives an example of the language template file. In Figure 3 the language texts corresponding to the same unique identifier id are on the same line. In some other examples, the language texts corresponding to the same unique identifier id can also be in the same column, or other adjacent positions. The embodiments of the present application do not limit this.

[0087] In this embodiment, as a markup language, the structured characteristics of XML make the language template easy to parse and process, facilitating machine reading and generation. In the XML file, the language texts with the same unique identifier are placed in the same entry, and a unique identifier is used to associate the language texts in the first region and the second region. This mapping method simplifies the process of searching and replacing, and improves the efficiency of automated tools in processing language files.

[0088] In some embodiments, modifying the language text of the first language data in the language template file to obtain the second language data includes:

[0089] Determining the target language text to be modified in the first region;

[0090] Modifying the language text in the second region adjacent to the target language text, and determining the language text in the second region as the second language data.

[0091] In this embodiment, the first area and the second area have different functions. In the first area, you can clearly know which language texts are included in the language file. If you find that some language texts in the first area need to be modified, you can modify the corresponding parts in the second area. Figure 3 As shown, for the language text "EMF change model" at the first area raw, if you want to modify the language text to "EMF change model", you can find the position of the second area msg adjacent to it, and then modify the language text "EMF change model" at msg to "EMF change model", thus completing the modification of a language text.

[0092] In this embodiment, by determining the target language text to be modified in the first area and modifying the language text in the adjacent position in the second area accordingly, the consistency of the content of the language text with the same unique identifier in the two areas is improved. In addition, since the language text with the same unique identifier in the first area and the second area is in adjacent positions, the modification operation can be more intuitive and convenient.

[0093] In some implementations, writing the second language data into the language file according to the unique identifier so that the second language data replaces the first language data in the language file includes:

[0094] Extracting each language text in the second region to obtain second language data;

[0095] The corresponding language text in the language file is matched with the unique identifier as a key, and the language text with the same unique identifier in the second language data replaces the corresponding language text in the language file.

[0096] In this embodiment, if you want to implement language switching in the software, you also need to write the language text of the second language data into the language file. Specifically, you can extract each language text in the second area of ​​the language template file to obtain the second language data, and each language text has a unique identifier. Figure 3 For example, after the language text "EMF change model" is modified to "EMF change model" in msg, the unique identifier remains unchanged, that is, the language text "EMF change model" and "EMF change model" can still be associated through the unique identifier "pluginName". If you want to replace the language text in the language file with the language text of the second language data, you can match it with the unique identifier as the key. For example, for the replacement of "EMF change model", you can first find the location of the corresponding language text "EMF change model" in the language file through the unique identifier "pluginName", and then write "EMF change model" under this location to replace the language text "EMF change model".

[0097] In this embodiment, the second language data is obtained by extracting each language text in the second area, and then the corresponding language text in the language file is matched using the unique identifier as a matching basis. There is no need to manually check and replace each entry, which reduces erroneous replacements caused by similar or repeated text content and improves the accuracy of the replacement process.

[0098] According to one embodiment of the present application, the method further includes:

[0099] Package the replaced language files into a language plug-in that can be recognized by the software.

[0100] In this embodiment, the replaced language files may be packaged according to the requirements of the software, for example, the replaced language files may be placed in a specific directory structure, or a compressed package may be created.

[0101] For example, for Eclipse software, the replaced language file properties can be repackaged into a compressed package through zip, and the suffix name can be changed to .jar, so that the compressed package becomes a language plug-in that can be recognized by Eclipse.

[0102] In this embodiment, a convenient and efficient language update and distribution mechanism is provided by packaging the replaced language files into a language plug-in recognizable by the software. In the form of a plug-in, the software can dynamically load or switch language packages without recompiling or reinstalling the entire application, thereby simplifying the software's multi-language support process and allowing users to easily download and install corresponding language plug-ins according to their language preferences or needs.

[0103] The software language switching method provided in the embodiment of the present application can be executed by a software language switching device. In the embodiment of the present application, the software language switching method executed by the software language switching device is taken as an example to illustrate the software language switching device provided in the embodiment of the present application.

[0104] The embodiment of the present application also provides a software language switching device.

[0105] like Figure 4 As shown, the language switching device of the software includes:

[0106] Filling module 410, used to fill the first language data in the language file used by the software into a preset language template file; wherein each language text of the first language data in the language template file corresponds to a unique identifier;

[0107] A modification module 420, configured to modify the language text of the first language data in the language template file to obtain the second language data;

[0108] The replacement module 430 is configured to write the second language data into the language file according to the unique identifier, so that the second language data replaces the first language data in the language file.

[0109] According to the language switching device of the software of the present application, the first language data in the language file used by the software is filled into a preset language template file; wherein each language text of the first language data in the language template file corresponds to a unique identifier; the language text of the first language data is modified in the language template file to obtain the second language data; the second language data is written into the language file according to the unique identifier, so that the second language data replaces the first language data in the language file. The embodiment of the present application allows rapid positioning of each language text through a unique identifier through the design of the language template file, and the language text of the first language data can be modified as needed to generate the second language data, and then the modified second language data is accurately written into the original language file using the unique identifier, thereby ensuring the accuracy of the replacement process, thereby simplifying the language switching process, and supporting custom modification of the language, improving the efficiency of software language switching, and enhancing the internationalization and localization capabilities of the software.

[0110] In some embodiments, the filling module 410 is further configured to:

[0111] Extracting first language data from language files;

[0112] The first language data is filled into the first area and the second area of ​​the language template file respectively; wherein the language texts with the same unique identifier in the first area and the second area are in adjacent positions.

[0113] In some embodiments, the modification module 420 is further configured to:

[0114] Determining the target language text that needs to be revised in the first area;

[0115] The language text in the second region adjacent to the target language text is modified, and the language text in the second region is determined as the second language data.

[0116] In some embodiments, the replacement module 430 is further configured to:

[0117] Extracting each language text in the second region to obtain second language data;

[0118] Use the unique identifier as the key to match the corresponding language text in the language file, and replace the language text with the same unique identifier in the second language data with the corresponding language text in the language file

[0119] In some embodiments, the language switching device of the software further includes a packaging module for:

[0120] Package the replaced language files into a language plug-in that can be recognized by the software.

[0121] The language switching device of the software in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a palmtop computer, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobilepersonal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.

[0122] The language switching device of the software in the embodiment of the present application may be a device having an operating system. The operating system may be a Microsoft (Windows) operating system, an Android (Android) operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0123] In some embodiments, Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the program is executed by the processor 501, each process of the language switching method embodiment of the above-mentioned software is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0124] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0125] The embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the language switching method embodiment of the above-mentioned software are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0126] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0127] An embodiment of the present application also provides a computer program product, including a computer program, which implements the language switching method of the above software when executed by a processor.

[0128] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0129] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the language switching method embodiment of the above-mentioned software, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0130] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0131] It should be noted that, in this article, the term "comprises", "includes" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0132] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0133] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0134] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0135] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A method for switching the language of software, characterized in that: include: Filling the first language data in the language file used by the software into a preset language template file; wherein each language text of the first language data in the language template file corresponds to a unique identifier; Modifying the language text of the first language data in the language template file to obtain second language data; The second language data is written into the language file according to the unique identifier, so that the second language data replaces the first language data in the language file.

2. The method according to claim 1, characterized in that The step of filling the first language data in the language file used by the software into the preset language template file comprises: extracting first language data from the language file; The first language data is filled into the first area and the second area of ​​the language template file respectively; wherein the language texts with the same unique identifier in the first area and the second area are in adjacent positions.

3. The method according to claim 2, characterized in that The language template file is a file in XML format, and the language texts with the same unique identifier in the first area and the second area are in the same entry.

4. The method according to claim 2, characterized in that: The modifying the language text of the first language data in the language template file to obtain the second language data includes: Determining the target language text that needs to be modified in the first area; The language text in the second region adjacent to the target language text is modified, and the language text in the second region is determined as the second language data.

5. The method according to claim 2, characterized in that: The step of writing the second language data into the language file according to the unique identifier so that the second language data replaces the first language data in the language file includes: extracting each language text in the second region to obtain second language data; The corresponding language text in the language file is matched with the unique identifier as a key, and the language text with the same unique identifier in the second language data replaces the corresponding language text in the language file.

6. The method according to claim 1, characterized in that The method further comprises: The replaced language files are packaged into a language plug-in recognizable by the software.

7. The method according to claim 1, characterized in that The software includes eclipse, and the language file is a properties file.

8. A software language switching device, characterized in that: include: A filling module, used to fill the first language data in the language file used by the software into a preset language template file; wherein each language text of the first language data in the language template file corresponds to a unique identifier; A modification module, used for modifying the language text of the first language data in the language template file to obtain second language data; A replacement module is used to write the second language data into the language file according to the unique identifier, so that the second language data replaces the first language data in the language file.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.