Language configuration method and device for client application program and electric vehicle
By acquiring and storing language data in the vehicle-mounted application and generating a language list for users to choose from, the problem of limited language configuration in the existing technology is solved, flexible language display and efficient maintenance are achieved, and maintenance costs are reduced.
Patent Information
- Application Number
- CN202410747794.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Existing in-vehicle applications have limited language configuration methods, cannot define display content according to the personal habits of different users, and have high maintenance costs.
By obtaining the language data to be added, it is stored in the application's default language configuration file, a language list is generated for the user to select, and the user interface display content of the application is updated according to the target language version selected by the user.
It optimizes the language configuration process, improves the efficiency of version language application, reduces the consumption of manpower and material resources, flexibly displays content according to different user definitions, reduces enterprise maintenance costs, and improves the efficiency and accuracy of language version switching.
Smart Images

Figure CN118656115A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of vehicle-mounted 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 electronic technology, in-vehicle applications are widely used in cars, and the internationalization of supporting applications has become a major trend. Users from different countries want to use applications in their own language.
[0003] At present, in the field of vehicle application control technology, the language configuration method of the application is basically to directly select different language settings in the code and execute different codes to display the interface display information. However, this method often has problems such as the types of applicable languages are greatly limited, the display content cannot be defined according to the personal habits of different users, and the application maintenance is troublesome. Summary of the invention
[0004] In view of the above problems, 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 solution of the present disclosure is 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] The language data to be added is stored in a language configuration file preset by the application; wherein the language configuration file is preset with historical language data of at least one language version including the default language version;
[0008] 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;
[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 the language data corresponding to the target language version is displayed in the user interface of the application, the method further includes:
[0011] In response to triggering a replacement request for displayed content in the user interface, obtaining a unique identifier corresponding to a text string to be replaced;
[0012] Based on the unique identifier, querying 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 the 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] In the case where the tool configuration file is not obtained through query, a second configuration value matching the unique identifier is searched in a resource repository for the customized settings of the application, and the display content in the user interface is replaced based on the second configuration value; the resource repository is used to partially or completely replace the configuration value of the unique identifier;
[0015] In the case that the second configuration value is not obtained by querying 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 searching the application for a tool configuration file that matches the target language version includes:
[0018] Based on the priority order or the specified order among the multiple sub-configurations, a target sub-configuration file matching the target language version is queried from the multiple sub-configurations.
[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 is set to an off state among the multiple sub-configuration files, 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 for 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 processed in multiple languages, 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 built into the application.
[0026] In an exemplary embodiment, the acquiring 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 background server;
[0028] If there is new language data 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 the case that the system language version is not an existing language version, a predefined one of 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 the case where the system language version is not the existing language version, based on a preset language adding strategy, adding the language data corresponding to the system language version to the language configuration file for storage;
[0037] The language adding strategy includes one of a single user compatible strategy, a partial user compatible strategy, and a partial user and region compatible strategy.
[0038] In an exemplary embodiment, after the language data corresponding to the target language version is displayed in the user interface of the application, the method further includes:
[0039] Obtaining a language error report triggered by text content of a function control displayed in the user interface;
[0040] Based on the language error report, requesting correct language data about 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, used to 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;
[0044] An information storage module, used for storing the language data to be added in a language configuration file preset by the application; wherein the language configuration file is preset with historical language data of at least one language version including the default language version;
[0045] A version selection module, for 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;
[0046] The language display module is used 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 a 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, wherein the computer program product includes program instructions, and when the program instructions are executed by a processor of a computer device, the computer device is enabled to execute a language configuration method for a client application as described in any one of the above items.
[0051] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0052] On the one hand, this solution first stores the language data to be added in the language configuration file preset by the application; then generates a language list based on the language version corresponding to each 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; 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 is different 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 users to choose through the language list, and applies the target language version selected by the user as the current language version of the application, so that the display content of different language versions can be flexibly defined 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 conducive 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 present 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 drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. 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 creative work.
[0055] Figure 1 The present invention 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 of a client application according to an exemplary embodiment.
[0057] Figure 3 The present invention is a module diagram showing a language configuration method of a client application according to an exemplary embodiment.
[0058] Figure 4 The present invention is an interface diagram showing display contents in a display user interface according to an exemplary embodiment.
[0059] Figure 5 The present invention is a flowchart showing steps of 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 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 solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present 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 enumerated items. It should also be noted that when used in this specification, "include / comprise" specifies the presence of 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 their groups.
[0065] The terms "first", "second", etc. in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0066] In addition, although the terms "first", "second", etc. are used many times in this application to describe various operations (or various elements or various applications or various instructions or various data), etc., these operations (or elements or applications or instructions or data) should not be limited by these terms. These terms are only used to distinguish one operation (or element or application or instruction or data) from another operation (or element 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 through 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 the language configuration file is preset with historical language data of at least one language version including the default language version; 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; 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.
[0069] In some embodiments, the terminal 102 (such as a mobile terminal, a fixed terminal) can be implemented in various forms. The terminal 102 can be a mobile terminal including a mobile phone, a smart phone, a laptop, 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 automatic all-in-one machine, a digital TV, a desktop computer, a fixed computer, etc.
[0070] In the following, it is assumed that the terminal 102 is a fixed terminal. However, it will be understood by those skilled in the art that the configuration according to the embodiments disclosed in the present application can also be applied to a mobile type 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 suitable for running one or more application services or software components that provide the terminal 102 described in the above disclosure.
[0073] In some embodiments, the operating system on which the application service or software component runs may include various versions of Microsoft Windows®, Apple Macintosh® and / or Linux operating systems, various commercial or UNIX®-like operating systems (including but not limited to various GNU / Linux operating systems, Google Chrome® OS, etc.) and / or mobile operating systems, such as iOS®, Windows® Phone, Android® OS, BlackBerry® OS, Palm® OS operating systems, and other online operating systems or offline operating systems, without specific limitation here.
[0074] In some embodiments, Figure 2 and Figure 3 As shown, Figure 2 This is a flow chart of an embodiment of a method for configuring a language of a client application in this application. Figure 3 This is a schematic diagram of a module in an embodiment of a method for configuring a language of a client application in this application, and the method is applied to Figure 1 Taking the server 104 in the example as an example, the method includes the following steps:
[0075] Step S11: Acquire language data to be added for the application and the default language version used by the application.
[0076] Specifically, when executing language configuration for an application, the server first obtains one or more new, unpreset language data to be added to the application, and the default language version currently used by the application, wherein the language data to be added includes text strings different from the default language version.
[0077] In one embodiment, the language data includes a text string for display in a user interface of an application, a unique identifier of the text string, and related language code data, wherein the text string and / or the unique identifier may directly constitute display content in the user interface, and the unique identifier is 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 may 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: "Device code"=" ";
[0082] Language key: "skip"=" ";
[0083] Language key: "Fingerprint verification successful"=" ";
[0084] Language key: "Fingerprint verification is closed"=" ";
[0085] Language key: "Face ID verification successful"=" ";
[0086] Language key: "Face ID verification is turned off"=" ";
[0087] Language key: "Fingerprint shutdown failed"=" ";
[0088] Language key: "Face ID shutdown failed"=" ".
[0089] Take Persian as an example:
[0090] Language key: "Device code"=" ";
[0091] Language key: "skip"=" ";
[0092] Language key: "Fingerprint verification successful"=" ";
[0093] Language key: "Fingerprint verification is closed"=" ";
[0094] Language key: "Face ID verification successful"=" ";
[0095] Language key: "Face ID verification is turned off"=" ";
[0096] Language key: "Fingerprint shutdown failed"=" ";
[0097] Language key: "Face ID shutdown failed"=" ".
[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 is started, detect in the local sandbox of the application whether there is new language data sent by the background server.
[0100] Step 2: If the newly added language data exists in the local sandbox, extract the newly added language data; or, if the newly added language data does not exist in the local sandbox, send a data acquisition request to the background server to obtain the newly added language data.
[0101] Specifically, when the application is started, the server can detect in the local sandbox of the application whether the application needs to add one or more languages, that is, the newly added language data sent by the background server. If yes, the newly added language data in the local sandbox is directly extracted; if not, a data acquisition request is sent to the background server to obtain all the newly added language data corresponding to the one or more languages, including the key and the corresponding language string, so as to realize the server's supplement of the full language data of the application.
[0102] 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, so as to realize the server's supplementation 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 include 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 one of the existing language versions 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] Among them, the predefined default language is pre-determined by business needs according to policies, and it may be related to the export region. For example, the default language version of the Chinese application is Chinese, and the default language version of the 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 has preset historical language data of at least one language version including a default language version.
[0112] Specifically, the language data used by the application is a subset of all the language data versions preset by the application, which is less than or equal to the number of language versions in the language configuration file. We use the configuration file to store the relationship between the application and the languages it uses. For example, there may be 8 languages preset in the application, but only 6 languages are displayed to users when the application is exported to a certain country. The language configuration file stores these 6 languages and displays them on the interface for users to switch.
[0113] In one embodiment, the server needs to create a language configuration file in advance. The specific implementation of the file can be a cloud service, blockchain, file, database, etc.
[0114] Among them, according to business needs, the language configuration for different applications is different. For example, the language configuration of the domestic vehicle control application is English and Function; the language configuration of the Russian vehicle control application is Russian, Spanish, English, and Chinese; the language configuration of the Israeli vehicle control application is 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 and switching 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 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 and the language configuration file, different language data are used, which takes effect in the compilation stage.
[0118] In one embodiment, the server may provide a user interface for users to switch languages freely. Among them, the list of languages for users to choose 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 preset 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 used by default in the user's mobile phone system, the list of languages on the interface that the user sees is: 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 supplement of some control languages and the supplement of all languages, is a remedial measure, which is applied after the application has released a package or the user has downloaded it. In addition, the present application scheme also provides another method for partially or completely replacing the value of an existing language key, which 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; finally, the default implementation function of the main program of the application is executed. 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 scheme stores the language data to be added in the language configuration file preset by the application program first; then generates a language list based on the language version corresponding to each language data stored in the language configuration file, and displays the language list in the user interface of the application program 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 program to display the language data corresponding to the target language version in the user interface of the application program, thereby optimizing the language configuration process of the client application program, effectively improving the efficiency of version language application, and reducing the consumption of manpower and material resources; on the other hand, the scheme is different 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 choose through the language list, and applies the target language version selected by the user as the current language version of the application program, so as to flexibly define 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 program, which is beneficial to the development and application of electric vehicles.
[0124] Those skilled in the art can understand that in the above method of the specific implementation, the disclosed method can be implemented in a more specific manner. For example, the above described server generates a language list based on the language version corresponding to each 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 only illustrative.
[0125] In an exemplary embodiment, in step S11, before the server obtains the language data to be added for 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 strings, such as "[^\x00-\x7F]+" to search for all 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 according to the requirements, so as to perform multilingual processing on the target text string that needs to be processed in multiple languages, wherein the target text string includes a text string used as a unique identifier.
[0132] Among them, some text strings are in the form of "xxx", "yyy", which are multi-language processed by calling ".globalize" when used, and some text strings are in the form of "xxx".globalize, which are multi-language set at the beginning of definition and should be treated differently. The .globalize here is globalization processing (i.e. multi-language processing). Among them, the specific implementation method of globalization processing can be adopted by the commonly used methods on the market.
[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 after globalization processing into the application program.
[0135] In one embodiment, when using the language number built into the application, that is, when you want to display the language version corresponding to a certain string, the server can execute the following steps: ① First read whether the language version corresponding to the voice key has been configured in the memory. ② If not in the memory, use the language version in the bundle file of the main project. ③ If not in the bundle file, search for the translation file corresponding to the language version under the main project, such as en.lproj, because these translation files may not be under the bundle file of the main project. ④ If not in the translation file, 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 belongs to an existing language version stored in the language configuration file, it may further specifically include: if the system language version is not an existing language version, based on a preset language adding 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 language version currently used by the system is not in the preset language of the language configuration file, it will be reported to the backend server. The backend server will make a decision based on the preset language addition strategy after automatic statistical analysis, synchronize the information to the corresponding processing personnel, and prompt the language version to be added to the preset language list.
[0139] The language adding strategy includes one of a single user compatible strategy, a partial user compatible strategy, and a partial user and region compatible 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 preset 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 preset language configuration file or language library and put it into the next App release version. After a user downloads the latest package, he can obtain the ability of this language version.
[0141] As another example, it is checked in the Israeli car control app that a user's system language is set to Korean, and this language version is not included in the preset language configuration file or language library of the app. If the car control policy of the background server is "compatible with some users", the background 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 can obtain the ability of this language version.
[0142] As another example, it is checked in the Israeli car control app that a user's system language is set to Korean, and this language version is not included in the preset language configuration file or language library of the app. If the car control strategy of the background server is "compatible with some users + regions", the background 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 release version of the App corresponding to this region. After a user in the region downloads the latest package, he can obtain the ability of this language version.
[0143] In one embodiment, if the application is available in a certain language, but some parts are not translated due to business development or other reasons, 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 the present 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 specifically 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 of 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 supplement of some control languages and the supplement of all languages, is a remedial measure, which is applied after the application has released a package or the user has downloaded it. In addition, the present application scheme also provides another method for partially or completely replacing the value of an existing language key, which 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 value of the key 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 multi-language adaptation 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] Among them, value is one of the basic elements in the program, used to represent data and status. The key in the key-value pair is a unique identifier used to identify the text content (i.e., the language key), and the value is the corresponding text content or translation.
[0154] The value corresponding to the language key refers to the specific text content or translation associated with the language key during the internationalization and localization process. When the user selects a specific language, the program will look up the corresponding value based on the language key and then display it to the user.
[0155] In an exemplary embodiment, see Figure 5 , Figure 5 This is a flow chart of an embodiment of replacing the displayed content in the user interface in the present 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 specifically included:
[0156] Step S15: In response to triggering a replacement request for 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, query 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 generate a tool configuration file in advance. The tool configuration file can be a cloud service, blockchain, file, database, etc. in specific implementation; and, the tool configuration file is not just one specific file in specific implementation, but may be composed of multiple sub-files, such as: a language is a sub-configuration file; and, in terms of content, the tool configuration file stores the language key and a text string corresponding to the language key, which is the string seen by the user.
[0162] What is 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 content of the tool configuration file is:
[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 may also pre-generate a bundle file (resource repository) which is used to partially or completely replace the configuration value of the unique identifier. In this bundle file, multi-language configuration may be used, that is, a Localizable.strings file corresponding to each language is generated, which contains the value corresponding to the language key in different languages. The advantage of the bundle file is that the application system can directly replace the value of the language key according to the current language.
[0170] What content is 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 structural diagram of an embodiment of a multi-language replacement tool in this application. The multi-language replacement tool includes a tool configuration file and a bundle file, and the tool configuration file and the bundle file actually configure certain language keys of the application in different places. Among them, the language key in the tool configuration file and the language key in the bundle file can be the same or different, and can have an intersection or no intersection.
[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 above tool configuration file, but no "ccc".
[0176] In an exemplary embodiment, in step S16, the server queries the tool configuration file matching the target language version in the application, which may specifically include: based on the priority order or specified order among the multiple sub-configurations, querying a target sub-configuration file matching the target language version from the multiple sub-configurations.
[0177] In fact, the tool configuration file is a multi-language replacement tool, that is, as a language replacer, it is essentially a patch, which can have multiple sub-language tools, and there can be priorities among the multiple sub-tools. For example, the server can maintain a configuration file of the execution order of multiple sub-language tools, update it at any time, and send it to the client, so as to flexibly adjust its order and participants at any time.
[0178] As an example, there is the following order relationship between multiple sub-language tools and the main project program of the application: tool A, tool B, tool C, tool D, main project. Then, the execution order of the server to query the sub-language tools matching the target language version in the application is: when the program wants to use a string, first determine whether tool A is installed; if installed, query the language configuration of tool A, and use it if it is installed, and if not, query whether tool B is installed, and if installed, query the language configuration of tool B, and if not, continue to query until the main project is queried.
[0179] As another example, there is the following order relationship between multiple sub-language tools and the main project program of the application: tool B, main project, tool D. Then, the execution order of the server querying the sub-language tool matching the target language version in the application is: when the program wants to use a string, first determine whether tool B is installed. If it is installed, query the language configuration of tool B first, and use it if it is installed; if not, query the main project, and use it if it is installed; if not, query whether tool D is installed, and use it if it is installed; if not, continue to query until tool D is found.
[0180] In other embodiments, the content of a sub-configuration file may specify the content to be replaced, similar to the following example: "language keyX" specifies the use of tool A, and "language keyY" specifies the use of tool B. Then, the server searches for the execution order of the sub-language tool matching the target language version in the application program as follows: when the program wants to use a string, its language key is language keyX, and the execution order described in the sub-configuration file should be used. However, the configuration file specifies that tool A needs to be specified, so "language keyX" is forced to use the sub-configuration file of tool A. The same applies to "language keyY".
[0181] In an exemplary embodiment, in step S16, before the server queries the tool configuration file matching the target language version in the application, it may also specifically include: when the application is started or idle, downloading a customized designated sub-configuration file from the background server to the application 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, 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 instruction. Before this step, the application can consult the server configuration in advance whether it needs to force download a certain tool, such as tool A in the above embodiment.
[0183] As an example, if Tool A is a very important patch in terms of language functions, if the client does not add it, it will not be able to display these languages. Therefore, if the server configuration file specifies that Tool A must be downloaded compulsorily, Tool A needs to be downloaded in advance and integrated into the App. Specifically, at the beginning of the App startup or when the App is idle, the application starts a thread to download the tools (such as Tool A) specified in the configuration file to be downloaded compulsorily in the background, so that when querying Tool A, the application can quickly update its sub-configuration file.
[0184] As another example, the server can also control the deletion, validation, and invalidation of language tools. Specifically, for a language tool, its content may be outdated or translated incorrectly, and the latest version of the tool needs to be updated online; or the old version of the tool needs to be directly deleted to make it invalid, and a new tool needs to be used instead. Among them, the optional operations for deleting a tool are: accepting server commands and directly deleting it from the application code; or accepting server commands and retaining the tool library, but configuring the switch status of the tool.
[0185] Step S17: When a 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 a resource repository for customized application 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 a 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 language currently used by the application, and then queries in the application whether there is a tool configuration file that matches the target language version; if so, the first configuration value of the tool configuration file is searched according to the unique identifier, and the displayed content in the user interface is replaced based on the first configuration value. For example: the language currently used by the application is Chinese, and the unique identifier is "ccc", so the first configuration value is "change mobile 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 taking effect. 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] In this way, on the one hand, this solution first stores the language data to be added in the language configuration file preset by the application; then generates a language list based on the language version corresponding to each 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; 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 is different 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 users to choose through the language list, and applies the target language version selected by the user as the current language version of the application, so that the display content of different language versions can be flexibly defined 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 conducive 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 according to the arrows, but these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be performed in other orders. Moreover, 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 execution order of these steps or stages is not necessarily sequential, 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 refer to each other, and each embodiment focuses on the differences from other embodiments. For related points, please refer to the description of other method embodiments.
[0192] Figure 7 1 is a structural block diagram of a language configuration device for a client application provided in an embodiment of the present application. Figure 7 The language configuration device 10 of the client application comprises: 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 used to 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;
[0194] The information storage module 12 is used to store the language data to be added in a language configuration file preset by the application; wherein the language configuration file is preset with historical language data of at least one language version including the default language version;
[0195] The version selection module 13 is used 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 used 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 execute:
[0198] In response to triggering a replacement request for displayed content in the user interface, obtaining a unique identifier corresponding to a text string to be replaced;
[0199] Based on the unique identifier, querying 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 the 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] In the case where the tool configuration file is not obtained through query, a second configuration value matching the unique identifier is searched in a resource repository for the customized settings of the application, and the display content in the user interface is replaced based on the second configuration value; the resource repository is used to partially or completely replace the configuration value of the unique identifier;
[0202] In the case that the second configuration value is not obtained by querying 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 the aspect of 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 execute:
[0205] Based on the priority order or the specified order among the multiple sub-configurations, a target sub-configuration file matching the target language version is queried from the multiple sub-configurations.
[0206] In one embodiment, before searching the application for a tool configuration file that matches the target language version, the language configuration device 10 of the client application is further configured to execute:
[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 is set to an off state among the multiple sub-configuration files, 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 execute:
[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 processed in multiple languages, 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 built into 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 used to execute:
[0214] When the application is started, detecting in the local sandbox of the application whether there is newly added language data sent by the background server;
[0215] If there is new language data 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 used to execute:
[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 the case that the system language version is not an existing language version, a predefined one of 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 execute:
[0223] In the case where the system language version is not the existing language version, based on a preset language adding strategy, adding the language data corresponding to the system language version to the language configuration file for storage;
[0224] The language adding strategy includes one of a single user compatible strategy, a partial user compatible strategy, and a partial user and region compatible 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 execute:
[0226] Obtaining a language error report triggered by text content of a function control displayed in the user interface;
[0227] Based on the language error report, requesting correct language data about 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 is a block diagram of an electric vehicle provided in an embodiment of the present application. Figure 8 , the electric vehicle includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the 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 the 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, etc. Exemplary database servers include, but are not limited to, database servers commercially available from (International Business Machines) and the like.
[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 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 the interaction between the user's electric vehicle and the processor using the multimedia component to control.
[0232] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the language configuration method of the client application program as described above is implemented.
[0233] If the integrated units of 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. The computer-readable storage medium includes several 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, which can be executed by a processor of an electric vehicle to implement the language configuration method of a client application as described above.
[0235] Those skilled in the art should understand that the 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. Moreover, 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 the client application, the language configuration device for the 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 product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A 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 The steps for the functions specified 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] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present 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 that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are 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 may 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, It is 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; The language data to be added is stored in a language configuration file preset by the application; wherein the language configuration file is preset with historical language data of at least one language version including the default language version; 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; 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.
2. The method according to claim 1, It is 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: In response to triggering a replacement request for displayed content in the user interface, obtaining a unique identifier corresponding to a text string to be replaced; Based on the unique identifier, querying 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; In the 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; In the case where the tool configuration file is not obtained through query, a second configuration value matching the unique identifier is searched in a resource repository for the customized settings of the application, and the display content in the user interface is replaced based on the second configuration value; the resource repository is used to partially or completely replace the configuration value of the unique identifier; In the case that the second configuration value is not obtained by querying 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 2, It is characterized in that The tool configuration file includes a plurality of sub-configuration files; The searching the application for a tool configuration file that matches the target language version includes: Based on the priority order or the specified order among the multiple sub-configurations, a target sub-configuration file matching the target language version is queried from the multiple sub-configurations.
4. The method according to claim 3, It is 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 is set to an off state among the multiple sub-configuration files, or the sub-configuration file to be invalidated is deleted, so as to update the multiple sub-configuration files.
5. The method according to claim 1, It is characterized in that Before acquiring the language data to be added for 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 processed in multiple languages, 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 built into the application.
6. The method according to claim 1, It is characterized in that The acquiring of the language data to be added for 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 background server; If there is new language data 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.
7. The method according to claim 1, It is characterized in that Before obtaining the default language version used 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 the case that the system language version is not an existing language version, a predefined one of the existing language versions is used as a default language version of the application program.
8. The method according to claim 7, It is 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 the case where the system language version is not the existing language version, based on a preset language adding strategy, adding the language data corresponding to the system language version to the language configuration file for storage; The language adding strategy includes one of a single user compatible strategy, a partial user compatible strategy, and a partial user and region compatible strategy.
9. The method according to claim 1, It is 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 function control displayed in the user interface; Based on the language error report, requesting correct language data about 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.
10. A language configuration device for a client application, It is characterized in that The device comprises: An information acquisition module, used to 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; An information storage module, used for storing the language data to be added in a language configuration file preset by the application; wherein the language configuration file is preset with historical language data of at least one language version including the default language version; A version selection module, for 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; The language display module is used 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.
11. An electric vehicle, It is 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 as described in any one of claims 1-9.
Citation Information
Patent Citations
Mobile phone language and input method switching device and switching method
CN102158585A
Language setting method and apparatus
CN106648575A
File processing method and device, terminal equipment and computer readable medium
CN110457085A
International processing method and device, computer device and storage medium
CN110673920A
Application language dynamic switching method and device, storage medium and electronic equipment
CN110716777A
Cited By
Application state adjusting method and system, storage medium and electronic device
CN121478366A
