Language configuration method and device for client application and electric vehicle
By storing language data in the in-vehicle application and generating a language list for users to choose from, the problem of limited language configuration is solved, efficient and flexible multi-language display is achieved, maintenance costs are reduced and switching efficiency is improved.
Patent Information
- Application Number
- CN202410747794.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-06-11
AI Technical Summary
The language configuration method of existing in-vehicle applications is limited in the types of applicable languages, cannot define display content according to the personal habits of different users, and is difficult to maintain.
By obtaining the language data to be added and storing it in the language configuration file of the application, a language list is generated for the user to choose. According to the user's selection, the application is the current language version, supports the display of multiple language versions, and displays the target language data in the user interface.
It optimizes the language configuration process, improves the efficiency of version language application, reduces manpower and material resource consumption, flexibly defines display content according to user habits, reduces enterprise maintenance costs, and improves the efficiency and accuracy of display content switching.
Smart Images

Figure CN118656115B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of in-vehicle clients, and in particular to a language configuration method for a client application, a language configuration device for a client application, an electric vehicle, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the rapid development of automotive electronics, in-vehicle applications are being widely used in cars. Domestic automotive equipment has gone global, and the internationalization of supporting applications has become a major trend. Users in different countries want to use applications in their own language.
[0003] Currently, in the field of vehicle application control technology, the language configuration method for applications is typically to directly select different language settings in the code and execute different code to display interface information. However, this method often has significant limitations on the number of languages that can be used, cannot customize display content based on individual user preferences, and is difficult to maintain. Summary of the Invention
[0004] To address the above issues, the present disclosure provides a language configuration method for a client application, a language configuration device for a client application, an electric vehicle, a computer-readable storage medium, and a computer program product. The technical solutions of the present disclosure are as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a language configuration method for a client application is provided, comprising:
[0006] Acquire language data to be added for the application, and a default language version used by the application; the language data to be added includes a text string different from the default language version;
[0007] Storing the language data to be added in a language configuration file preset by the application; wherein the language configuration file is pre-set with historical language data of at least one language version including the default language version;
[0008] generating a language list based on the language versions corresponding to the language data stored in the language configuration file, and displaying the language list in the user interface of the application program to obtain the target language version selected by the user;
[0009] The target language version is applied as the current language version of the application program, so that language data corresponding to the target language version is displayed in a user interface of the application program.
[0010] In an exemplary embodiment, after displaying the language data corresponding to the target language version in the user interface of the application, the method further includes:
[0011] In response to triggering a request to replace displayed content in the user interface, obtaining a unique identifier corresponding to a text string to be replaced;
[0012] Based on the unique identifier, searching the application for a tool configuration file that matches the target language version; the tool configuration file is used to partially or completely replace a configuration value of the unique identifier;
[0013] In a case where the tool configuration file is obtained through query, a first configuration value corresponding to the unique identifier is extracted from the tool configuration file, and display content in the user interface is replaced based on the first configuration value;
[0014] If the tool configuration file is not retrieved, searching a resource repository for customized settings of the application for a second configuration value that matches the unique identifier, and replacing the displayed content in the user interface based on the second configuration value; the resource repository is used to partially or completely replace the configuration value of the unique identifier;
[0015] If the second configuration value is not found in the resource repository, the text string to be replaced and the unique identifier are stored in the language configuration file, and the display content in the user interface is replaced based on the language configuration file.
[0016] In an exemplary embodiment, the tool profile includes a plurality of sub-profiles;
[0017] The step of searching the application for a tool configuration file that matches the target language version includes:
[0018] Based on the priority order or the designated order among the multiple sub-configurations, a target sub-configuration file matching the target language version is searched from the multiple sub-configurations files.
[0019] In an exemplary embodiment, before searching the application for a tool configuration file that matches the target language version, the method further includes:
[0020] When the application is started or idle, downloading a customized designated sub-configuration file from a backend server to the application to update the multiple sub-configuration files;
[0021] When the application is started or idle, the switch of the sub-configuration file to be invalidated in the multiple sub-configuration files is set to an off state, or the sub-configuration file to be invalidated is deleted, so as to update the multiple sub-configuration files.
[0022] In an exemplary embodiment, before acquiring the language data to be added to the application, the method further includes:
[0023] Performing a global search on the application to obtain a text string in the application that needs to be displayed in the user interface;
[0024] performing type recognition on the text string to identify a target text string that needs to be multilingually processed, and performing multilingual processing on the target text string to obtain a processed target text string; wherein the target text string includes a text string used as a unique identifier;
[0025] The language data of the language version corresponding to the processed target text string is embedded in the application.
[0026] In an exemplary embodiment, obtaining language data to be added to the application includes:
[0027] When the application is started, detecting in the local sandbox of the application whether there is newly added language data sent by the backend server;
[0028] If the new language data exists in the local sandbox, extract the new language data;
[0029] When the newly added language data does not exist in the local sandbox, a data acquisition request is sent to the background server to acquire the newly added language data.
[0030] In an exemplary embodiment, before obtaining the default language version used by the application, the method further includes:
[0031] Read the system language version of the application system where the application is located;
[0032] Identifying the system language version based on the language configuration file to determine whether the system language version belongs to an existing language version stored in the language configuration file;
[0033] In the case where the system language version is an existing language version, using the system language version as the default language version of the application program;
[0034] In a case where the system language version is not an existing language version, a predefined language version in the existing language versions is used as a default language version of the application program.
[0035] In an exemplary embodiment, after determining whether the system language version belongs to an existing language version stored in the language configuration file, the method further includes:
[0036] In a case where the system language version is not the existing language version, adding the language data corresponding to the system language version to the language configuration file for storage based on a preset language adding strategy;
[0037] The language adding strategy includes one of a single user compatibility strategy, a partial user compatibility strategy, and a partial user and region compatibility strategy.
[0038] In an exemplary embodiment, after displaying the language data corresponding to the target language version in the user interface of the application, the method further includes:
[0039] Obtaining a language error report triggered by text content of a functional control displayed in the user interface;
[0040] Based on the language error report, requesting correct language data of the text content corresponding to the target language version from a backend server;
[0041] In the user interface, the text content of the function control is replaced with the text content corresponding to the correct language data.
[0042] According to a second aspect of an embodiment of the present disclosure, a language configuration device for a client application is provided, comprising:
[0043] An information acquisition module, configured to acquire language data to be added to an application program and a default language version used by the application program; the language data to be added includes a text string different from the default language version;
[0044] An information storage module, configured to store the language data to be added in a language configuration file preset by the application; wherein the language configuration file is pre-set with historical language data of at least one language version including the default language version;
[0045] a version selection module, configured to generate a language list based on the language versions corresponding to the language data stored in the language configuration file, and display the language list in the user interface of the application program to obtain the target language version selected by the user;
[0046] The language display module is configured to apply the target language version as the current language version of the application program, so as to display language data corresponding to the target language version in the user interface of the application program.
[0047] According to a third aspect of an embodiment of the present disclosure, there is provided an electric vehicle, comprising:
[0048] A processor and a memory connected to the processor, wherein the memory stores program data, and the processor is used to call the program data stored in the memory to implement the language configuration method of the client application as described in any one of the above items.
[0049] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes program data, and when the program data is executed by a processor of a computer device, the computer device is enabled to execute the language configuration method for a client application as described in any one of the above items.
[0050] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, which includes program instructions. When the program instructions are executed by a processor of a computer device, the computer device is capable of executing the language configuration method for a client application as described in any one of the above items.
[0051] The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:
[0052] On the one hand, this solution first stores the language data to be added in a language configuration file preset by the application; then, based on the language versions corresponding to the language data stored in the language configuration file, generates a language list and displays the language list in the application's user interface to obtain the target language version selected by the user; finally, the target language version is applied as the current language version of the application to display the language data corresponding to the target language version in the application's user interface, thereby optimizing the language configuration process of the client application, effectively improving the efficiency of version language application, and reducing the consumption of manpower and material resources; on the other hand, this solution, unlike existing software flashing methods, first stores the language data to be added in the historical language data of at least one language version, including the default language version, so that multiple language versions are displayed in a language list for user selection, and the target language version selected by the user is applied as the current language version of the application. This allows for flexible definition of display content for different language versions based on the personal habits of different users, effectively reducing enterprise maintenance costs and improving the efficiency and accuracy of switching display content between different language versions of the application, which is beneficial to the development and application of electric vehicles.
[0053] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0055] Figure 1 The figure is an application environment diagram showing a language configuration method for a client application according to an exemplary embodiment.
[0056] Figure 2 The present invention is a flowchart showing a language configuration method for a client application according to an exemplary embodiment.
[0057] Figure 3 The present invention is a module diagram showing a language configuration method for a client application according to an exemplary embodiment.
[0058] Figure 4 The present invention is an interface diagram showing display content in a user interface according to an exemplary embodiment.
[0059] Figure 5 The present invention is a flowchart showing steps for replacing displayed content in a user interface according to an exemplary embodiment.
[0060] Figure 6 The figure is a structural diagram of a multi-language replacement tool according to an exemplary embodiment.
[0061] Figure 7 The present invention is a structural block diagram showing a language configuration device for a client application according to an exemplary embodiment.
[0062] Figure 8 The present invention is a block diagram of an electric vehicle for client application language configuration according to an exemplary embodiment. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0064] The term "and / or" in the embodiments of the present application refers to any and all possible combinations of one or more of the associated listed items. It should also be noted that when used in this specification, "include / comprise" specifies the presence of the stated features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements and / or components and / or groups thereof.
[0065] The terms "first," "second," and the like in this application are used to distinguish between different objects, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.
[0066] In addition, although the terms "first" and "second" are used many times in this application to describe various operations (or various components or various applications or various instructions or various data), these operations (or components or applications or instructions or data) should not be limited by these terms. These terms are only used to distinguish one operation (or component or application or instruction or data) from another operation (or component or application or instruction or data).
[0067] The language configuration method of the client application provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 via a communication network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104 or placed on the cloud or other network servers.
[0068] In some embodiments, reference Figure 1 The server 104 obtains language data to be added for the application and a default language version used by the application; the language data to be added includes a text string different from the default language version; the language data to be added is stored in a language configuration file preset by the application; wherein historical language data of at least one language version including the default language version is preset in the language configuration file; a language list is generated based on the language version corresponding to each language data stored in the language configuration file, and the language list is displayed in the user interface of the application to obtain a target language version selected by the user; the target language version is applied as the current language version of the application, so that the language data corresponding to the target language version is displayed in the user interface of the application.
[0069] In some embodiments, the terminal 102 (e.g., a mobile terminal, a fixed terminal) can be implemented in various forms. The terminal 102 can be a mobile terminal such as a mobile phone, a smart phone, a laptop computer, a portable handheld device, a personal digital assistant (PDA), a tablet computer (PAD), etc. The terminal 102 can also be a fixed terminal such as an automated teller machine (ATM), an all-in-one kiosk, a digital TV, a desktop computer, a fixed-type computer, etc.
[0070] In the following, it is assumed that the terminal 102 is a fixed terminal. However, those skilled in the art will appreciate that the configuration according to the embodiments disclosed herein can also be applied to a mobile terminal 102 if there are operations or elements specifically for mobile purposes.
[0071] In some embodiments, the data processing component running on the server 104 may load any of a variety of additional server applications and / or middle-tier applications being executed, such as HTTP (Hypertext Transfer Protocol), FTP (File Transfer Protocol), CGI (Common Gateway Interface), RDBMS (Relational Database Management System), etc.
[0072] In some embodiments, the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers. The server 104 may be adapted to run one or more application services or software components that provide the terminal 102 described in the foregoing disclosure.
[0073] In some embodiments, the operating systems running the application services or software components may include various versions of Microsoft Apple and / or Linux operating system, various commercial or similar Operating systems (including but not limited to various GNU / Linux operating systems, Google OS, etc.) and / or mobile operating systems such as Phone, OS, OS, The OS operating system, as well as other online operating systems or offline operating systems, are not specifically limited here.
[0074] In some embodiments, as Figure 2 and Figure 3 As shown, Figure 2 This is a flow chart of an embodiment of a method for configuring a language for a client application in this application. Figure 3This is a module diagram of an embodiment of a language configuration method for a client application in this application, in which the method is applied to Figure 1 Taking the server 104 in FIG. 1 as an example, the method includes the following steps:
[0075] Step S11: Acquire language data to be added to the application and the default language version used by the application.
[0076] Specifically, when performing language configuration for an application, the server first obtains one or more new, unpreset language data to be added to the application, as well as the default language version currently used by the application. The language data to be added includes text strings that are different from the default language version.
[0077] In one embodiment, the language data includes a text string for display in the user interface of the application, a unique identifier for the text string, and related language code data. The text string and / or the unique identifier may directly constitute display content in the user interface, and the unique identifier serves as a language key for the text string.
[0078] In some embodiments, for example, "change password" or "control air conditioning temperature" already exists as a language key of a text string. In the implementation of some applications, these language keys can also be some unique keys, such as numbers, random numbers, etc.
[0079] As an example, here are the language keys for two language versions of the text strings used in the code:
[0080] Take Hebrew as an example:
[0081] Language key:
[0082] Language key:
[0083] Language key:
[0084] Language key:
[0085] Language key:
[0086] Language key:
[0087] Language key:
[0088] Language key:
[0089] Take Persian as an example:
[0090] Language key:
[0091] Language key:
[0092] Language key:
[0093] Language key:
[0094] Language key:
[0095] Language key:
[0096] Language key:
[0097] Language key:
[0098] In one embodiment, the process of the server acquiring the language data to be added to the application may specifically include the following steps:
[0099] Step 1: When the application starts, check in the local sandbox of the application whether there is new language data sent by the backend server.
[0100] Step 2: If the new language data exists in the local sandbox, extract the new language data; or, if the new language data does not exist in the local sandbox, send a data acquisition request to the backend server to obtain the new language data.
[0101] Specifically, at the initial launch of an application, the server can detect in the application's local sandbox whether the application requires one or more new languages, i.e., the newly added language data sent by the backend server. If so, the server directly retrieves the newly added language data from the local sandbox. If not, the server sends a data retrieval request to the backend server to obtain all the language data corresponding to the one or more newly added languages, including the key and the corresponding language string, thereby enabling the server to supplement the application's full language data.
[0102] Among them, when the background server sends the newly added language data, the application can generate a mapping relationship in the memory, store the language data of one or several language versions (including the language key and the corresponding text string) in the memory, and land it in the sandbox, and then execute subsequent steps to realize the server's supplement of the full language data of the application.
[0103] In one embodiment, before obtaining the default language version used by the application, the server may further perform the following steps:
[0104] Step 1: Read the system language version of the application system where the application is located.
[0105] Step 2: Identify the system language version based on the language configuration file to determine whether the system language version belongs to an existing language version stored in the language configuration file.
[0106] Step 3: If the system language version is an existing language version, use the system language version as the default language version of the application; or, if the system language version is not an existing language version, use a predefined language version in the existing language version as the default language version of the application.
[0107] Specifically, after the initial installation of the application, if the user has not selected the language version displayed by the program, the system language version of the application system is first read, and then the system language version is identified through the language configuration file or language library of the application to determine whether the system language version belongs to an existing language version of the application; if the system language version belongs to an existing language version, the application will use this language by default, that is, the system language version will be used as the default language version of the application; if the system language version does not belong to an existing language version, the application will use a pre-defined default language as the default language version when the application is initialized.
[0108] The predefined default language is determined by business needs and policies, and may be related to the export region. For example, the default language version of a Chinese application is Chinese, and the default language version of an application exported to the United States is English.
[0109] Step S12: storing the language data to be added in a language configuration file preset by the application.
[0110] Specifically, the server stores the language data to be added in a language configuration file preset by the application.
[0111] The language configuration file is pre-set with historical language data of at least one language version including a default language version.
[0112] Specifically, the language data used by an application is a subset of all pre-configured language versions, which is less than or equal to the number of language versions in the language configuration file. We use configuration files to store the relationship between applications and their used languages. For example, an application may have eight pre-configured languages, but only six are displayed to users when exporting to a specific country. The language configuration file stores these six languages and displays them on the user interface for users to switch between.
[0113] In one embodiment, the server needs to pre-create a language configuration file, which can be implemented in a cloud service, blockchain, file, database, etc.
[0114] Different applications have different language configurations based on business needs. For example, the Chinese and English language configurations are used for the domestic vehicle control application; the Russian vehicle control application is configured in Russian, Chinese, Spanish, and English; and the Israeli vehicle control application is configured in Hebrew, Arabic, Spanish, English, German, and French.
[0115] Step S13: Generate a language list based on the language versions corresponding to the language data stored in the language configuration file, and display the language list in the user interface of the application program to obtain the target language version selected by the user.
[0116] Among them, the application can control the language currently displayed to the user for selection based on the language configuration file.
[0117] Among them, the language configuration method provided by this application can be used in the application development stage and after the application has been put on the shelf. There is another method, which is limited to the application development stage. If the application has been released, it may require users to update and download it before it can take effect. Specifically, first define the macro in the application project, and different applications set different values for the macro. For example, the domestic car control app sets the macro value to 1, and the Russian car control app sets the macro value to 2; then, according to the different macro definitions, different language data are used according to the language configuration file. This takes effect during the compilation stage.
[0118] In one embodiment, the server may provide a user interface for users to switch languages freely. The list of languages for users to choose from is only the number of languages currently supported by the App and displayed to users as required by business requirements, rather than the number of languages carried by the App as a whole. (For example, 8 languages are pre-installed in the App, but only 6 languages are displayed to users when the App is exported to a certain country. The language configuration file stores these 6 languages and displays them on the interface for users to switch.) For example, the Israeli car control app is in Hebrew, Arabic, Spanish, English, German, and French. If the server also decides to add Korean, which is the default language used by the user's mobile phone system, the list of languages on the interface that the user sees will be: Hebrew, Arabic, Spanish, English, German, French, and Korean.
[0119] Step S14: applying the target language version as the current language version of the application program, so as to display language data corresponding to the target language version in the user interface of the application program.
[0120] Specifically, after the user selects the target language version, the server can use the target language version to perform a global language replacement for the program. That is, when the user selects a language, the App immediately replaces all strings in the project with the version in this language.
[0121] In one embodiment, the language configuration mentioned in the above embodiment of the present application, including the addition of some control languages and the addition of all languages, is a remedial measure that is applied after the application package has been released or the user has downloaded it. In addition, the present application solution also provides another method for partially or completely replacing the value of an existing language key. It can be used in the above situation and can also be used in the development stage of the application, which is very flexible.
[0122] As an example, Figure 3 As shown, the language configuration scheme of the present application may include a first stage of "server supplementation" and a second stage of using a "language replacement tool". In the first stage, the application detects whether the background server has a need to add one or more language configurations; if so, it downloads and stores the newly added one or more language data; and then uses a certain configured language data as the language currently used by the application. In the second stage, the background server first queries the current language used by the application, and queries and uses the value of the configuration file; if it is not found, it uses the custom bundle file of the query tool; and finally executes the default implementation function of the main program of the application. For the specific implementation process of the first and second stages, please see the specific description in the subsequent embodiments, which is only a brief summary here.
[0123] On the one hand, the above solution first stores the language data to be added in a language configuration file preset by the application; then, based on the language versions corresponding to the language data stored in the language configuration file, a language list is generated, and the language list is displayed in the user interface of the application to obtain the target language version selected by the user; finally, the target language version is applied as the current language version of the application to display the language data corresponding to the target language version in the user interface of the application, thereby optimizing the language configuration process of the client application, effectively improving the efficiency of version language application, and reducing the consumption of manpower and material resources; on the other hand, this solution, by differentiating from the existing software flashing method, first stores the language data to be added in the historical language data of at least one language version, including the default language version, so as to display multiple language versions for the user to select through the language list, and applies the target language version selected by the user as the current language version of the application, thereby flexibly defining the display content of different language versions according to the personal habits of different users, effectively reducing the maintenance cost of the enterprise, and improving the efficiency and accuracy of switching the display content of different language versions of the application, which is beneficial to the development and application of electric vehicles.
[0124] Those skilled in the art will appreciate that the disclosed methods in the specific embodiments described above may be implemented in more specific ways. For example, the above-described embodiment in which the server generates a language list based on the language versions corresponding to the language data stored in the language configuration file and displays the language list in the user interface of the application to obtain the target language version selected by the user is merely illustrative.
[0125] In an exemplary embodiment, in step S11, before the server obtains the language data to be added to the application, the server may further include the following steps:
[0126] Step 1: Perform a global search on the application to obtain the text strings that need to be displayed in the user interface of the application.
[0127] Specifically, the server may perform a global search string on the application to obtain a text string in the application that needs to be displayed in the user interface.
[0128] The server can use XCode or other text search tools to search for all strings in the application project. This action can be completed using a system script, such as a bash script or a python script.
[0129] The server can use regular expressions to identify character strings, such as "[^\x00-\x7F]+" to search for all character strings.
[0130] Step 2: Perform type recognition on the text string to identify the target text string that needs to be processed in multiple languages, and perform multilingual processing on the target text string to obtain a processed target text string.
[0131] Specifically, the server can perform type identification on the search results as required to perform multilingual processing on the target text string that needs to be multilingually processed, wherein the target text string includes a text string used as a unique identifier.
[0132] Some text strings, such as "xxx" and "yyy," require ".globalize" for multilingual processing when used. Other text strings, such as "xxx".globalize, are multilingualized from the outset and should be treated differently. The ".globalize" method here refers to globalization processing (i.e., multilingual processing). The specific implementation of globalization processing can be done using commonly used methods.
[0133] Step 3: embed the language data of the language version corresponding to the processed target text string into the application.
[0134] Specifically, the server embeds the language data corresponding to the text strings that have been counted and globalized into the application.
[0135] In one embodiment, when using the language library built into an application, that is, when displaying the language version corresponding to a particular string, the server may perform the following steps: ① First, check whether the language version corresponding to the voice key is configured in memory. ② If not, use the language version in the main project bundle file. ③ If not, search for the translation file corresponding to the language version in the main project, such as en.lproj, as these translation files may not be in the main project bundle file. ④ If not, directly use the language key as the value to return.
[0136] In an exemplary embodiment, in step S11, after the server determines whether the system language version is an existing language version stored in the language configuration file, the server may further specifically include: if the system language version is not an existing language version, based on a preset language addition strategy, adding the language data corresponding to the system language version to the language configuration file for storage.
[0137] Specifically, in order to adapt to the preferences of different users, at the beginning of the application startup, the server can read the language version currently used by the application system and add it to the language configuration file.
[0138] If the system's current language version isn't among the preset languages in the language configuration file, the information is reported to the backend server. The server automatically performs statistical analysis, makes a decision based on the preset language addition strategy, and synchronizes the information with the appropriate personnel, prompting the language version to be added to the preset language list.
[0139] The language adding strategy includes one of a single user compatibility strategy, a partial user compatibility strategy, and a partial user and region compatibility strategy.
[0140] As an example, in the Israeli car control app (i.e., application), it is checked that a user's system language is set to Korean, and this language version is not included in the pre-set language configuration file or language library of the app. If the car control policy of the background server is "compatible with a single user", the corresponding processing personnel will be notified. After processing and translation, the corresponding processing personnel will add this language version to the pre-set language configuration file or language library and put it into the next App release version. After a user downloads the latest package, he or she can obtain the ability of this language version.
[0141] As another example, in the Israeli car control app, it is detected that a user's system language is set to Korean. Currently, this language version is not included in the app's preset language configuration file or language library. If the backend server's car control policy is "compatible with some users", the backend server will count the number of Korean users. When the preset threshold is reached, the corresponding processing personnel will be notified. After processing and translation, the corresponding processing personnel will add this language version to the preset language configuration file or language library and put it into the next app release. After a user downloads the latest package, he or she can obtain the capabilities of this language version.
[0142] As another example, in the Israeli car control app, it is detected that a user's system language is set to Korean. Currently, this language version is not included in the pre-set language configuration file or language library of the app. If the backend server's car control strategy is "compatible with some users + regions", the backend server will count the number of Korean users. When the preset threshold is reached, the corresponding processing personnel will be notified. After processing and translation, the corresponding processing personnel will add this language version to the pre-set language configuration file or language library, and put it into the next release version of the app corresponding to this region. After a user in the region downloads the latest package, he or she can obtain the capabilities of this language version.
[0143] In one embodiment, if an application has a certain language version, but due to business development or other reasons, some parts are not translated, it will reduce the user experience, e.g. Figure 4 As shown, Figure 4This is an interface diagram of an embodiment of the display content in the user interface of this application. It can be found that the corresponding text content in the P1 area at the bottom of the user interface is not translated, and it is still the Chinese version. Because this is a requirement added by the application after the release version, this part of the content on the application can be replaced with the proper form through server supplementation.
[0144] In an exemplary embodiment, in step S14, after the server displays the language data corresponding to the target language version in the user interface of the application, the following steps may be further included:
[0145] Step 1: Obtain a language error report triggered by the text content of a functional control displayed in the user interface.
[0146] Specifically, the server detects error reports for a certain control language in the user interface, which may be actively discovered and reported by the user (for example, the user clicks on error feedback), or actively discovered and reported by other processing personnel, applications, or other third-party tool libraries.
[0147] Step 2: Based on the language error report, request the backend server for the correct language data for the target language version of the text content.
[0148] Specifically, the application requests the backend server for the correct language data of a certain language version of the content, so that the backend server returns the correct language data of the corresponding language version.
[0149] Step 3: In the user interface, replace the text content of the function control with the text content corresponding to the correct language data.
[0150] Specifically, when a function control is displayed in the user interface, the text content on the function control is replaced with the correct language data returned by the background server.
[0151] In one embodiment, the language configuration mentioned in the above embodiment of the present application, including the addition of some control languages and the addition of all languages, is a remedial measure that is applied after the application package has been released or the user has downloaded it. In addition, the present application solution also provides another method for partially or completely replacing the value of an existing language key. It can be used in the above situation and can also be used in the development stage of the application, which is very flexible.
[0152] Specifically, the multi-language adaptation key of the App can be a string used in the original code, or any code, such as a random number. The content of its value is usually stored in a bundle file (a resource repository) in the default implementation on the market, but the value corresponding to the key anywhere can also be read. Therefore, this application also supports replacing the language value corresponding to one or more existing keys; to perform multilingualization again based on the language value; and to encapsulate it as a tool for the App to freely integrate, delete, take effect, and invalidate.
[0153] A value is a fundamental element in a program, representing data and state. In a key-value pair, the key is a unique identifier for the text (i.e., the language key), and the value is the corresponding text or translation.
[0154] The value corresponding to a language key refers to the specific text or translation associated with the language key during internationalization and localization. When the user selects a specific language, the program searches for the corresponding value based on the language key and displays it to the user.
[0155] In an exemplary embodiment, see Figure 5 , Figure 5 This is a flowchart of an embodiment of replacing the displayed content in the user interface in this application. After step S14, that is, after the language data corresponding to the target language version is displayed in the user interface of the application, the following steps may be further included:
[0156] Step S15: In response to triggering a request to replace the displayed content in the user interface, a unique identifier corresponding to the text string to be replaced is obtained.
[0157] Specifically, when a user response triggers a replacement request for a certain displayed content in the user interface, the server first obtains a unique identifier of the text string to be replaced corresponding to the replacement request, that is, a language key.
[0158] Step S16: Based on the unique identifier, search the application for a tool configuration file that matches the target language version.
[0159] Specifically, the language key is the input parameter of the ".globalize" method, that is, a known value. The server can use the language key to query the tool configuration file that matches the target language version in the application.
[0160] In one embodiment, the tool configuration file includes multiple sub-configuration files, and the tool configuration file is used to partially or completely replace the configuration value of the unique identifier.
[0161] Specifically, the server can pre-generate a tool configuration file. This tool configuration file can be implemented as a cloud service, blockchain, file, database, etc. Furthermore, this tool configuration file can be more than just a single file, but may consist of multiple sub-files, such as a sub-configuration file for each language. Furthermore, the tool configuration file contains the language key and the text string corresponding to the language key, which is the string that the user sees.
[0162] The content stored in the tool configuration file is determined by business needs and is used to partially or completely replace the existing language key value. For example:
[0163] Under the Chinese sub-configuration file, the content of the tool configuration file is:
[0164] Key: "ccc" value: It means "change mobile phone number";
[0165] Key: "ddd" value: It means "Please enter the mobile phone number of another user".
[0166] Under the English sub-configuration file, the contents of the tool configuration file are:
[0167] Key: "ccc" value: It means "Change phone number";
[0168] Key: "ddd" value: It means "Please enter other phone number".
[0169] In one embodiment, the server can also pre-generate a bundle file (resource repository) for partially or fully replacing the configuration value of the unique identifier. This bundle file can be used for multi-language configuration, specifically generating a Localizable.strings file for each language, which contains the values corresponding to the language keys in each language. The advantage of the bundle file is that the application system can directly replace the language key value based on the current language.
[0170] The content stored in the custom bundle file is determined by business needs and is used to partially or completely replace the existing key value. This has the same function as the tool configuration file.
[0171] In an exemplary embodiment, see Figure 6 , Figure 6This is a schematic diagram of the structure of an embodiment of the multi-language replacement tool in this application. The multi-language replacement tool includes a tool configuration file and a bundle file. The tool configuration file and the bundle file actually configure certain language keys for the application in different locations. The language keys in the tool configuration file and the bundle file can be the same or different, and may or may not overlap.
[0172] For example, the content of the file corresponding to a language in the bundle file is:
[0173] Key: "ddd" value: "Please enter other phone number";
[0174] Key: "fff" value: "Set security password";
[0175] It has the "ddd" and "fff" from the tool configuration file above, but no "ccc".
[0176] In an exemplary embodiment, in step S16, the server searches for a tool configuration file that matches the target language version in the application, which may specifically include: based on the priority order or specified order among the multiple sub-configurations, searching for a target sub-configuration file that matches the target language version from the multiple sub-configurations.
[0177] In practice, a tool configuration file is a multi-language replacement tool. As a language replacer, it's essentially a patch that can have multiple sub-language tools, each with its own priority order. For example, a server can maintain a configuration file that specifies the execution order of multiple sub-language tools, which can be updated and distributed to clients at any time, allowing for flexible adjustment of the order and participants.
[0178] As an example, the following order exists between multiple sub-language tools and an application's main project: Tool A, Tool B, Tool C, Tool D, and then the main project. The server then searches the application for sub-language tools that match the target language version in the following order: when the program wants to use a string, it first checks whether Tool A is installed. If so, it queries Tool A's language configuration. If not, it queries whether Tool B is installed. If so, it queries Tool B's language configuration. If not, it continues searching until it finds the main project.
[0179] As another example, the following order exists between multiple sub-language tools and the main project of an application: Tool B, main project, Tool D. Then, the server searches the application for sub-language tools that match the target language version in the following order: when the program wants to use a string, it first determines whether Tool B is installed. If so, it first queries Tool B's language configuration, and uses it if it is installed. If not, it then queries the main project, and uses it if it is installed. If not, it then queries whether Tool D is installed, and uses it if it is installed. If not, it continues searching until Tool D is found.
[0180] In other embodiments, the content of a sub-configuration file can specify the content it replaces, as in the following example: "Language key X" specifies the use of tool A, and "Language key Y" specifies the use of tool B. Then, the server searches the application for the execution order of the sub-language tools that match the target language version as follows: When the program uses a string whose language key is language key X, the execution order described in the sub-configuration file should be used. However, the configuration file specifies the use of tool A, so "Language key X" forces the use of the sub-configuration file for tool A. The same applies to "Language key Y."
[0181] In an exemplary embodiment, in step S16, before the server searches for a tool configuration file that matches the target language version in the application, the server may further specifically include: downloading a customized designated sub-configuration file from the background server to the application when the application is started or idle, so as to update multiple sub-configuration files; or, when the application is started or idle, setting the switch of the sub-configuration file to be invalidated in multiple sub-configuration files to an off state, or deleting the sub-configuration file to be invalidated, so as to update multiple sub-configuration files.
[0182] After the server deploys the tool on the application, the application can download the update online according to the server's instructions. Before this step, the application can consult the server's configuration in advance to determine whether it needs to force the download of a certain tool, such as tool A in the above embodiment.
[0183] For example, if Tool A is a critical patch for language functionality, the client won't be able to display these languages without it. Therefore, if the server's configuration file specifies that Tool A must be downloaded, Tool A must be pre-downloaded and integrated into the app. Specifically, at the start of the app or when the app is idle, the application starts a thread to download the tool (such as Tool A) specified in the configuration file in the background. This allows the application to quickly update its sub-configuration file when querying Tool A.
[0184] As another example, the server can also control the deletion, validation, and expiration of language tools. Specifically, the content of a language tool may become outdated or contain translation errors, necessitating an online update to the latest version of the tool, or the deleting of the old version, rendering it invalid and replacing it with a new one. The options for deleting a tool include: accepting a server command to directly delete it from the application code; or accepting a server command to retain the tool library but configure the tool's on / off state.
[0185] Step S17: When the tool configuration file is obtained through query, a first configuration value corresponding to the unique identifier is extracted from the tool configuration file, and the display content in the user interface is replaced based on the first configuration value; or, when the tool configuration file is not obtained through query, a second configuration value matching the unique identifier is queried in the resource repository for application customization settings, and the display content in the user interface is replaced based on the second configuration value; or, when the second configuration value is not obtained through query in the resource repository, the text string to be replaced and the unique identifier are stored in the language configuration file, and the display content in the user interface is replaced based on the language configuration file.
[0186] In one embodiment, when replacing the displayed content in the user interface, the server first queries the current language of the application, then checks within the application to see if there is a tool configuration file matching the target language version. If so, the server then searches the tool configuration file for the first configuration value based on the unique identifier and replaces the displayed content in the user interface based on the first configuration value. For example, if the current language of the application is Chinese and the unique identifier is "ccc," the first configuration value obtained is "Change Phone Number," and this first configuration value is returned.
[0187] In one embodiment, if no tool configuration file matching the target language version is found in the application, the custom bundle file is queried to see if there is a second configuration value matching the unique identifier; if so, the display content in the user interface is replaced based on the second configuration value.
[0188] In one embodiment, if no second configuration value matching the unique identifier is found in the custom bundle file, the default implementation of the main program of the application is executed, which is equivalent to the multi-language replacement tool not being effective. The default string originally corresponding to the unique identifier is used to embed the language data corresponding to the unique identifier into the application, thereby replacing the display content in the user interface.
[0189] Thus, on the one hand, this solution first stores the language data to be added in a language configuration file preset by the application; then, based on the language versions corresponding to the language data stored in the language configuration file, generates a language list and displays the language list in the user interface of the application to obtain the target language version selected by the user; finally, the target language version is applied as the current language version of the application to display the language data corresponding to the target language version in the user interface of the application, thereby optimizing the language configuration process of the client application, effectively improving the efficiency of version language application, and reducing the consumption of manpower and material resources; on the other hand, this solution, unlike the existing software flashing method, first stores the language data to be added in the historical language data of at least one language version, including the default language version, so that multiple language versions are displayed in a language list for user selection, and the target language version selected by the user is applied as the current language version of the application. This allows for flexible definition of display content of different language versions according to the personal habits of different users, effectively reducing enterprise maintenance costs and improving the efficiency and accuracy of switching display content of different language versions of the application, which is beneficial to the development and application of electric vehicles.
[0190] It should be understood that although Figure 2-Figure 6 The steps in the accompanying drawings are shown in sequence as indicated by the arrows, but these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction for the execution of these steps, and these steps can be performed in other orders. Figure 2-Figure 6 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The order of execution of these steps or stages is not necessarily one by one, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0191] It can be understood that the same / similar parts between the various embodiments of the above method in this specification can be referred to each other, and each embodiment focuses on the differences from other embodiments. For related parts, please refer to the description of other method embodiments.
[0192] Figure 7 This is a structural diagram of a language configuration device for a client application provided by an embodiment of the present application. Figure 7 The language configuration device 10 of the client application includes: an information acquisition module 11, an information storage module 12, a version selection module 13 and a language display module 14.
[0193] The information acquisition module 11 is configured to acquire language data to be added to the application and a default language version used by the application; the language data to be added includes a text string different from the default language version;
[0194] The information storage module 12 is configured to store the language data to be added in a language configuration file preset by the application; wherein the language configuration file is pre-set with historical language data of at least one language version including the default language version;
[0195] The version selection module 13 is configured to generate a language list based on the language versions corresponding to the language data stored in the language configuration file, and display the language list in the user interface of the application program to obtain the target language version selected by the user;
[0196] The language display module 14 is configured to apply the target language version as the current language version of the application program, so as to display language data corresponding to the target language version in the user interface of the application program.
[0197] In one embodiment, after the language data corresponding to the target language version is displayed in the user interface of the application, the language configuration device 10 of the client application is further configured to perform:
[0198] In response to triggering a request to replace displayed content in the user interface, obtaining a unique identifier corresponding to a text string to be replaced;
[0199] Based on the unique identifier, searching the application for a tool configuration file that matches the target language version; the tool configuration file is used to partially or completely replace a configuration value of the unique identifier;
[0200] In a case where the tool configuration file is obtained through query, a first configuration value corresponding to the unique identifier is extracted from the tool configuration file, and display content in the user interface is replaced based on the first configuration value;
[0201] If the tool configuration file is not retrieved, searching a resource repository for customized settings of the application for a second configuration value that matches the unique identifier, and replacing the displayed content in the user interface based on the second configuration value; the resource repository is used to partially or completely replace the configuration value of the unique identifier;
[0202] If the second configuration value is not found in the resource repository, the text string to be replaced and the unique identifier are stored in the language configuration file, and the display content in the user interface is replaced based on the language configuration file.
[0203] In one embodiment, the tool configuration file includes a plurality of sub-configurations;
[0204] In terms of searching for a tool configuration file that matches the target language version in the application, the language configuration device 10 of the client application is further configured to execute:
[0205] Based on the priority order or the designated order among the multiple sub-configurations, a target sub-configuration file matching the target language version is searched from the multiple sub-configurations files.
[0206] In one embodiment, before searching for a tool configuration file matching the target language version in the application, the language configuration device 10 of the client application is further configured to perform:
[0207] When the application is started or idle, downloading a customized designated sub-configuration file from a backend server to the application to update the multiple sub-configuration files;
[0208] When the application is started or idle, the switch of the sub-configuration file to be invalidated in the multiple sub-configuration files is set to an off state, or the sub-configuration file to be invalidated is deleted, so as to update the multiple sub-configuration files.
[0209] In one embodiment, before acquiring the language data to be added for the application, the language configuration device 10 of the client application is further configured to perform:
[0210] Performing a global search on the application to obtain a text string in the application that needs to be displayed in the user interface;
[0211] performing type recognition on the text string to identify a target text string that needs to be multilingually processed, and performing multilingual processing on the target text string to obtain a processed target text string; wherein the target text string includes a text string used as a unique identifier;
[0212] The language data of the language version corresponding to the processed target text string is embedded in the application.
[0213] In one embodiment, in the aspect of obtaining the language data to be added for the application, the language configuration device 10 of the client application is further configured to perform:
[0214] When the application is started, detecting in the local sandbox of the application whether there is newly added language data sent by the backend server;
[0215] If the new language data exists in the local sandbox, extract the new language data;
[0216] When the newly added language data does not exist in the local sandbox, a data acquisition request is sent to the background server to acquire the newly added language data.
[0217] In one embodiment, before obtaining the default language version used by the application, the language configuration device 10 of the client application is further configured to perform:
[0218] Read the system language version of the application system where the application is located;
[0219] Identifying the system language version based on the language configuration file to determine whether the system language version belongs to an existing language version stored in the language configuration file;
[0220] In the case where the system language version is an existing language version, using the system language version as the default language version of the application program;
[0221] In a case where the system language version is not an existing language version, a predefined language version in the existing language versions is used as a default language version of the application program.
[0222] In one embodiment, after determining whether the system language version belongs to an existing language version stored in the language configuration file, the language configuration device 10 of the client application is further configured to perform:
[0223] In a case where the system language version is not the existing language version, adding the language data corresponding to the system language version to the language configuration file for storage based on a preset language adding strategy;
[0224] The language adding strategy includes one of a single user compatibility strategy, a partial user compatibility strategy, and a partial user and region compatibility strategy.
[0225] In one embodiment, after the language data corresponding to the target language version is displayed in the user interface of the application, the language configuration device 10 of the client application is further configured to perform:
[0226] Obtaining a language error report triggered by text content of a functional control displayed in the user interface;
[0227] Based on the language error report, requesting correct language data of the text content corresponding to the target language version from a backend server;
[0228] In the user interface, the text content of the function control is replaced with the text content corresponding to the correct language data.
[0229] Figure 8 This is a block diagram of an electric vehicle provided by an embodiment of the present application. Figure 8 , the electric vehicle includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the electric vehicle is used to provide computing and control capabilities. The memory of the electric vehicle includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the electric vehicle is used to store mileage maintenance data of the electric vehicle. The input / output interface of the electric vehicle is used to exchange information between the processor and an external device. The communication interface of the electric vehicle is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements the language configuration method of the client application as described above.
[0230] In some embodiments, the electric vehicle is an electronic device in which a computing system can run one or more operating systems, including any of the operating systems discussed above and any commercially available server operating systems. The electric vehicle can also run any of a variety of additional server applications and / or middle-tier applications, including HTTP (Hypertext Transfer Protocol) servers, FTP (File Transfer Protocol) servers, CGI (Common Gateway Interface) servers, super servers, database servers, and the like. Exemplary database servers include, but are not limited to, database servers commercially available from, for example, International Business Machines.
[0231] In some embodiments, the processor generally controls the overall operation of the electric vehicle, such as operations associated with display, data processing, data communication, and recording operations. The processor may include one or more processor components to execute a computer program to perform all or part of the steps of the above-described method. In addition, the processor component may include one or more modules to facilitate interaction between the processor component and other components. For example, the processor component may include a multimedia module to facilitate interaction between the user's electric vehicle and the processor using the multimedia component to control the user's electric vehicle.
[0232] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-mentioned language configuration method for a client application.
[0233] If the units integrated into the functional units in the various embodiments of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer-readable storage medium includes a number of instructions in a computer program to enable a computer device (which can be a personal computer, a system server, or a network device, etc.), an electronic device (such as MP3, MP4, etc., or a smart terminal such as a mobile phone, a tablet computer, a wearable device, or a desktop computer, etc.) or a processor to execute all or part of the steps of the various implementation methods of the present application.
[0234] An embodiment of the present application provides a computer program product, which includes program instructions that can be executed by a processor of an electric vehicle to implement the above-mentioned language configuration method for a client application.
[0235] Those skilled in the art will appreciate that embodiments of the present application may provide a language configuration method for a client application, a language configuration device for a client application, an electric vehicle, a computer-readable storage medium, or a computer program product. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer program instructions (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0236] The present application is described with reference to the flowcharts and / or block diagrams of the language configuration method for a client application, the language configuration device for a client application, the electric vehicle, the computer-readable storage medium or the computer program product according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by a computer program product. These computer program products can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the program instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the functions in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0237] These computer program products can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the program instructions stored in the computer program product produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0238] These program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the program instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0239] It should be noted that the above-mentioned various methods, devices, electronic devices, computer-readable storage media, computer program products, etc. may also include other implementation methods according to the description of the method embodiments. The specific implementation methods can refer to the description of the relevant method embodiments and will not be described one by one here.
[0240] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.
[0241] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A language configuration method for a client application, characterized in that: The method comprises: Acquire language data to be added for the application, and a default language version used by the application; the language data to be added includes a text string different from the default language version; Storing the language data to be added in a language configuration file preset by the application; wherein the language configuration file is pre-set with historical language data of at least one language version including the default language version; generating a language list based on the language versions corresponding to the language data stored in the language configuration file, and displaying the language list in the user interface of the application program to obtain the target language version selected by the user; Applying the target language version as the current language version of the application program, so as to display language data corresponding to the target language version in a user interface of the application program; In response to triggering a request to replace displayed content in the user interface, obtaining a unique identifier corresponding to a text string to be replaced; Based on the unique identifier, searching the application for a tool configuration file that matches the target language version, the tool configuration file being used to partially or completely replace a configuration value of the unique identifier; The tool configuration file includes multiple sub-configurations, and searching for the tool configuration file that matches the target language version in the application includes: searching for a target sub-configuration file that matches the target language version from the multiple sub-configurations based on the priority order or specified order among the multiple sub-configurations.
2. The method according to claim 1, characterized in that The step of searching the application program for a tool configuration file that matches the target language version based on the unique identifier includes: In a case where the tool configuration file is obtained through query, a first configuration value corresponding to the unique identifier is extracted from the tool configuration file, and display content in the user interface is replaced based on the first configuration value; If the tool configuration file is not retrieved, searching a resource repository for customized settings of the application for a second configuration value that matches the unique identifier, and replacing the displayed content in the user interface based on the second configuration value; the resource repository is used to partially or completely replace the configuration value of the unique identifier; If the second configuration value is not found in the resource repository, the text string to be replaced and the unique identifier are stored in the language configuration file, and the display content in the user interface is replaced based on the language configuration file.
3. The method according to claim 1, characterized in that Before searching the application for a tool configuration file that matches the target language version, the method further includes: When the application is started or idle, downloading a customized designated sub-configuration file from a backend server to the application to update the multiple sub-configuration files; When the application is started or idle, the switch of the sub-configuration file to be invalidated in the multiple sub-configuration files is set to an off state, or the sub-configuration file to be invalidated is deleted, so as to update the multiple sub-configuration files.
4. The method according to claim 1, wherein Before obtaining the language data to be added to the application, the method further includes: Performing a global search on the application to obtain a text string in the application that needs to be displayed in the user interface; performing type recognition on the text string to identify a target text string that needs to be multilingually processed, and performing multilingual processing on the target text string to obtain a processed target text string; wherein the target text string includes a text string used as a unique identifier; The language data of the language version corresponding to the processed target text string is embedded in the application.
5. The method according to claim 1, wherein The step of obtaining language data to be added to the application includes: When the application is started, detecting in the local sandbox of the application whether there is newly added language data sent by the backend server; If the new language data exists in the local sandbox, extract the new language data; When the newly added language data does not exist in the local sandbox, a data acquisition request is sent to the background server to acquire the newly added language data.
6. The method according to claim 1, characterized in that Before obtaining the default language version applied by the application, it also includes: Read the system language version of the application system where the application is located; Identifying the system language version based on the language configuration file to determine whether the system language version belongs to an existing language version stored in the language configuration file; In the case where the system language version is an existing language version, using the system language version as the default language version of the application program; In a case where the system language version is not an existing language version, a predefined language version in the existing language versions is used as a default language version of the application program.
7. The method according to claim 6, characterized in that After determining whether the system language version belongs to an existing language version stored in the language configuration file, the method further includes: In a case where the system language version is not the existing language version, adding the language data corresponding to the system language version to the language configuration file for storage based on a preset language adding strategy; The language adding strategy includes one of a single user compatibility strategy, a partial user compatibility strategy, and a partial user and region compatibility strategy.
8. The method according to claim 1, characterized in that After displaying the language data corresponding to the target language version in the user interface of the application, the method further includes: Obtaining a language error report triggered by text content of a functional control displayed in the user interface; Based on the language error report, requesting correct language data of the text content corresponding to the target language version from a backend server; In the user interface, the text content of the function control is replaced with the text content corresponding to the correct language data.
9. A language configuration device for a client application, characterized in that: The device comprises: An information acquisition module, configured to acquire language data to be added to an application program and a default language version used by the application program; the language data to be added includes a text string different from the default language version; An information storage module, configured to store the language data to be added in a language configuration file preset by the application; wherein the language configuration file is pre-set with historical language data of at least one language version including the default language version; a version selection module, configured to generate a language list based on the language versions corresponding to the language data stored in the language configuration file, and display the language list in the user interface of the application program to obtain the target language version selected by the user; a language display module, configured to apply the target language version as the current language version of the application program, so as to display language data corresponding to the target language version in the user interface of the application program; After the language data corresponding to the target language version is displayed in the user interface of the application, the device is further used to: respond to a request to replace the displayed content in the user interface, and obtain a unique identifier corresponding to the text string to be replaced; based on the unique identifier, query the application for a tool configuration file that matches the target language version, and the tool configuration file is used to partially or completely replace the configuration value of the unique identifier; the tool configuration file includes multiple sub-configurations, and querying the application for the tool configuration file that matches the target language version includes: based on the priority order or specified order among the multiple sub-configurations, querying the target sub-configuration file that matches the target language version from the multiple sub-configurations.
10. An electric vehicle, characterized in that: The electric vehicle includes a processor and a memory connected to the processor, wherein program data is stored in the memory, and the processor is used to call the program data stored in the memory to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
File processing method and device, terminal equipment and computer readable medium
CN110457085A
Application language dynamic switching method and device, storage medium and electronic equipment
CN110716777A