Data processing method, electronic equipment and storage medium
By separating the management and distribution of translated files, using the file server and content distribution network, the problem of untimely international translation and update of front-end pages is solved, efficient management and rapid distribution of translated files are achieved, and user experience is improved.
Patent Information
- Application Number
- CN202411339782.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-27
AI Technical Summary
When the existing front-end page loads international translation entries, the translation files are embedded in the project, resulting in untimely updates and cumbersome operations, affecting the user experience.
By separating the management and distribution of translated files, using the file server to store classified translation files, obtaining and updating translated files from the file server, and using the content distribution network to cache and refresh, achieving rapid distribution and efficient management.
Improves the timeliness and ease of operation of translation files, reduces the workload of front-end developers, and improves the user experience.
Smart Images

Figure CN119201859A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, an electronic device and a storage medium. Background Art
[0002] Front-end internationalization refers to the process of designing and developing front-end applications so that they can adapt to and support multiple languages and regional settings.
[0003] The inventors discovered the following problems during their research: Currently, the front-end page reads internationalized translation entries by embedding the translation file into the front-end project and loading all the translation content at once when the page is loaded. This can easily lead to untimely updates of the internationalized translation of the front-end page and cumbersome update operations. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a data processing method, an electronic device and a storage medium, which separates the management and distribution of translation files and uses a file server to store classified translation files, thereby achieving efficient management and rapid distribution of translation files and improving user experience.
[0005] To achieve the above objectives, the present application provides a data processing method, comprising:
[0006] Acquire a first translation parameter of the front-end page, where the first translation parameter includes at least a business type and a language type;
[0007] Determine the name of the target translation file according to the first translation parameter;
[0008] A target translation file corresponding to the name is obtained from a translation file in a file server, where the file server is used to store translation files released by an internationalization platform.
[0009] In some embodiments, the first translation parameter further includes at least one of a geographical area type, a user type, a function module type, a priority, and a release cycle, and determining the name of the target translation file according to the first translation parameter includes:
[0010] The name of the target translation file is determined according to any one or a combination of multiple items in the first translation parameters.
[0011] In some embodiments, obtaining a target translation file corresponding to the name from a translation file in a file server includes:
[0012] A target translation file corresponding to the name is obtained from an edge node of a content distribution network, where the content distribution network is used to cache the translation files of the file server.
[0013] In some embodiments, the method further comprises:
[0014] In response to the incremental update of the file server, the translation file cached on the edge node of the content distribution network is refreshed, wherein the incremental update of the file server refers to the internationalization platform pushing the updated translation file to the file server.
[0015] In some embodiments, after obtaining the target translation file corresponding to the name from the translation file in the file server, the method further includes:
[0016] The target translation file is stored based on a state management tool.
[0017] In some embodiments, the method further comprises:
[0018] In response to refreshing the front-end page, obtaining a second translation parameter of the front-end page;
[0019] If the second translation parameter is different from the first translation parameter, the target translation file is obtained again according to the second translation parameter.
[0020] In some embodiments, the step of reacquiring the target translation file according to the second translation parameter includes:
[0021] Determine the name of the target translation file according to the first translation parameter;
[0022] If the target translation file is already stored locally, obtaining the locally stored target translation file;
[0023] If the target translation file is not stored locally, the target translation file corresponding to the name is obtained from the translation file in the file server.
[0024] In some embodiments, before obtaining the target translation file corresponding to the name from the translation file in the file server, the method further includes:
[0025] Generate a preset request according to the name of the target translation file, wherein the preset request is used to request to obtain the target translation file;
[0026] Sending the preset request to the file server.
[0027] The present application also provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of any of the above methods when executed by the processor.
[0028] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0029] From the above, the data processing method, electronic device and storage medium of the present application include: obtaining the first translation parameter of the front-end page, the first translation parameter at least including the business type and the language type; determining the name of the target translation file according to the first translation parameter; obtaining the target translation file corresponding to the name from the translation file of the file server, and the file server is used to store the translation files released by the internationalization platform. The technical solution of the present application realizes efficient management and rapid distribution of translation files by separating the management and distribution of translation files and using the file server to store the classified translation files, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 This is an application scenario diagram of a data processing method in the prior art.
[0032] Figure 2 The present invention is a flowchart of a data processing method provided according to an embodiment.
[0033] Figure 3 This is one of the application scenario diagrams of a data processing method provided according to an embodiment.
[0034] Figure 4 This is a second application scenario diagram of a data processing method provided according to an embodiment.
[0035] Figure 5 The figure is a schematic diagram of the structure of an electronic device provided according to an embodiment. DETAILED DESCRIPTION
[0036] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0037] It should be noted that, in this article, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined by their explanation in the specific embodiment or further combined with the context of the specific embodiment.
[0038] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in this article, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this article, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "at the time of..." or "when..." or "in response to determination". Furthermore, as used in this article, the singular forms "one", "one" and "the" are intended to also include plural forms, unless there is an opposite indication in the context. It should be further understood that the terms "comprising", "including" indicate that there are described features, steps, operations, elements, components, projects, kinds, and / or groups, but do not exclude the existence, occurrence or addition of one or more other features, steps, operations, elements, components, projects, kinds, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Thus, “A, B, or C” or “A, B and / or C” means “any of the following: A; B; C; A and B; A and C; B and C; A, B, and C.” An exception to this definition will occur only when a combination of elements, functions, steps, or operations are inherently mutually exclusive in some manner.
[0039] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are displayed in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and it can be performed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0040] It should be noted that in this article, step codes such as S1 and S2 are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial limitation on the order. When implementing the step, those skilled in the art may execute S2 first and then S1, etc., but these should all be within the scope of protection of this application.
[0041] 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.
[0042] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0043] The following is an explanation of the terms that may be involved in this application, as follows:
[0044] Internationalization platform: the internationalization term translation platform is a technical solution for centrally managing and processing multilingual content. It is used to collect terms that need to be translated, distribute terms for translation, and store translated terms.
[0045] Internationalized terms: refers to the text content that needs to be translated during the software development process in order to achieve multi-language support. These terms usually include various texts on the interface, prompts, error messages, help documents, and all other text content that needs to be displayed in different versions according to the user's region or language preference.
[0046] CDN (Content Delivery Network): is an Internet infrastructure consisting of a network of high-performance server nodes distributed around the world. It is used to distribute translation files over the network to improve file access efficiency.
[0047] Front-end local project: refers to the front-end development environment built on the developer's local computer.
[0048] Front-end page: It is the interface part that users can directly see and interact with through browsers and other client programs.
[0049] Front-end page application server: refers to the server used to host, build, package and distribute front-end pages and their related resources.
[0050] Vuex and Redux: State management solutions for front-end applications, used to store and access translation entries in front-end applications.
[0051] Please refer to Figure 1 The update and release process of existing internationalized terms is as follows: the internationalization platform collects terms that need to be translated internationally, distributes the terms for translation, and then exports the translation files. The translation files are imported into the front-end local project. The translation file updates are pushed to the remote code repository in the front-end local project. On the front-end page application server, the translation files are published to the online server along with the front-end project. The front-end project containing the translation files is deployed to the production environment to ensure that users can see the latest translation content.
[0052] It can be seen that after the front-end page reads the translation file, it needs to import the translation file into the front-end local project. The front-end page runs and reads the translation file of the corresponding language in the front-end local project. Using this method, the translation file needs to be exported from the internationalization platform first, and then imported into the front-end local project. The update of the translation entries in the front-end page must take effect after the version of the front-end local project is released. The change of the translation file depends on the file modification and online deployment update of the front-end local project, which causes the front-end developers to modify the translation file additionally. The update of the translation file depends on the release of the front-end local project, and the update timeliness is poor. When the front-end page is running, the full amount of translation files will be loaded at one time when entering the project page for the first time, and the method of obtaining the translation of the entry will be used in the page to translate the entry. Therefore, before each front-end version is released, the international translation entries need to be imported and exported, and the operation is highly repetitive. In addition, the translation file is based on the project, and all the translation files of the current language under the current project need to be obtained at one time, which may cause too many files to be loaded for the first page rendering, affecting the timeliness of the first screen of the page.
[0053] In order to solve the problems of the prior art, the present invention provides a Figure 2 The data processing method according to one embodiment is a flowchart of a data processing method. The data processing method can be implemented in software and / or hardware. In this embodiment, the execution subject of the data processing method is a computer device as an example.
[0054] like Figure 2 As shown, the data processing method of the embodiment of the present application includes the following steps:
[0055] S1, obtaining a first translation parameter of a front-end page, where the first translation parameter at least includes a business type and a language type.
[0056] In this embodiment, the first translation parameter is obtained from the front-end page, and the first translation parameter includes at least the business type (such as WeChat app can be divided into instant messaging business, small program business, video account business, etc.) and language type (such as simplified Chinese, English, etc.). In the front-end page, these parameters can be obtained through JavaScript or other front-end frameworks (such as React, Vue.js, etc.). These parameters can come from the user's operation (for example, the user selects simplified Chinese) or from the system default settings.
[0057] S2: Determine the name of the target translation file according to the first translation parameter.
[0058] In this embodiment, the name of the target translation file is determined based on the first translation parameter, that is, the name of the target translation file is generated according to the business type and / or language type. For example, the name of the target translation file can be obtained by combining "business name + language abbreviation".
[0059] S3, obtains the target translation file corresponding to the name from the translation file of the file server, where the file server is used to store the translation files released by the internationalization platform.
[0060] The front-end page can provide a multi-language display interface as needed. Specifically, the name of the target translation file is determined according to the current first translation parameter of the front-end page. A request is generated according to the name of the target translation file, and a request is initiated from the front end to the file server to obtain the corresponding translation file. The target translation file is loaded on the front-end page, and the content of the translation file is applied to the page elements. The front-end page dynamically loads the corresponding translation file and applies the translated text to the page to realize a multi-language display interface.
[0061] In some embodiments, the first translation parameter further includes at least one of a geographical area type, a user type, a function module type, a priority, and a release cycle, and determining the name of the target translation file according to the first translation parameter includes:
[0062] The name of the target translation file is determined according to any one or a combination of multiple items in the first translation parameter.
[0063] As an implementation of this embodiment, the translation parameters include not only the business type and language type, but also more dimensional information, such as geographic area type, user type, function module type, priority, and release status, etc. These parameters can be used alone or in combination to generate a specific translation file name to obtain a translation file split in a more refined manner.
[0064] Specifically, splitting by geographic region type means dividing the translation files according to geographic regions, such as Europe, Asia, America, etc. Splitting by user type means that for applications with user groups with different characteristics (such as corporate users and individual users), the translation entries can be split according to user groups. Splitting by functional module type, for example, login and registration module, shopping cart module, payment module, etc. Splitting by priority, for example, for large projects, it may be necessary to give priority to the translation of certain key business modules. Therefore, the translation tasks can be split according to priority, and the most important or urgent parts can be completed first. Splitting by release cycle means that for functions or applications with different release cycles (for example, the core functions are updated less frequently, while the secondary functions or marketing activities are updated more frequently), the translation tasks can be split according to these different release rhythms to obtain different translation files.
[0065] In some embodiments, obtaining a target translation file corresponding to the name from a translation file in a file server includes:
[0066] A target translation file corresponding to the name is obtained from an edge node of a content distribution network, and the content distribution network is used to cache the translation files of the file server.
[0067] It should be noted that the front-end page can obtain the translation file directly from the file server or from the edge node of the content distribution network. The content distribution network (CDN) is a widely used network architecture used to accelerate the distribution of content, thereby reducing the delay when users access resources. After the CDN detects that there are new translation files on the file server, it caches these files on the globally distributed edge nodes. The CDN can automatically refresh the cache periodically or according to specific policies (such as Webhooks), or the file server can actively notify the CDN about the update information to ensure that the translation files on the edge node are the latest. In this way, the front-end page can obtain the translation file from the edge node of the CDN. Since the edge nodes of the CDN are usually closer to the users, they can respond to requests faster, further improving the response speed and reducing latency.
[0068] In some embodiments, the data processing method further includes:
[0069] In response to the incremental update of the file server, the translation files cached on the edge nodes of the content distribution network are refreshed, wherein the incremental update of the file server refers to the internationalization platform pushing the updated translation files to the file server.
[0070] As an implementation method of this embodiment, the incremental update of the file server refers to updating only those files that have been modified on the file server, rather than replacing all files. Among them, the internationalization platform is responsible for the maintenance and update of translation files. When the internationalization platform completes the update of certain translation files, it will push these updated files to the file server to achieve incremental update of the file server. After the file server is incrementally updated, the CDN synchronously updates the translation files cached on its edge nodes. In this way, the update efficiency can be improved and unnecessary data transmission can be reduced.
[0071] In some embodiments, after obtaining the target translation file corresponding to the name from the translation file in the file server, the data processing method further includes:
[0072] Store target translation files based on state management tools.
[0073] As an implementation method of this embodiment, after obtaining the translation files, these translation files are stored in a state management tool. The state management tool can help manage the version of the file, track the change history of the file, and restore to the previous version when necessary. The state management tool can be Vuex, Redux, or other front-end application storage methods can be used to store the target translation files, such as Local Storage or Context API.
[0074] In some embodiments, the data processing method further includes:
[0075] In response to refreshing the front-end page, obtaining a second translation parameter of the front-end page;
[0076] If the second translation parameter is different from the first translation parameter, the target translation file is obtained again according to the second translation parameter.
[0077] As an implementation method of this embodiment, when the front-end page is refreshed, the user may have changed some front-end page settings before refreshing, such as selecting a different language or other parameters. At this time, it is necessary to re-acquire the second translation parameter, and decide whether to reload the translation file based on the second translation parameter. The second translation parameter may include but is not limited to business type, language type, geographic area type, user type, function module type, priority and publishing status, etc. The second translation parameter is compared with the previous first translation parameter. If the second translation parameter is different from the first translation parameter, it is necessary to re-acquire the target translation file based on the new translation parameter.
[0078] In some embodiments, obtaining the target translation file again according to the second translation parameter includes:
[0079] Determine the name of the target translation file according to the first translation parameter;
[0080] If the target translation file is already stored locally, then obtain the locally stored target translation file;
[0081] If the target translation file is not stored locally, the target translation file corresponding to the name is obtained from the translation file in the file server.
[0082] As an implementation method of this embodiment, please refer to Figure 3 , when the user opens the front-end page, the target translation file in the cache is obtained according to the current language type and business module of the front-end page defined in the route. If the corresponding target translation file is not stored in the cache, the target translation file is obtained from the file server according to the translation file name format defined with the internationalization platform. The target translation file obtained from the file server is saved through state management such as Vuex, Redux or other front-end application storage methods, and the corresponding translation method is called to display the target translation file on the front-end page. When the user chooses to switch the language on the front-end page, the target translation file in the cache is obtained according to the language type and business module after the switch. If the corresponding target translation file is not stored in the cache, it is obtained from the file server again. The target translation file obtained from the file server is cached, and the corresponding translation method is called to display the re-obtained target translation file on the front-end page to realize the language switching function of the front-end page.
[0083] In some embodiments, before obtaining the target translation file corresponding to the name from the translation file in the file server, the data processing method further includes:
[0084] Generate a preset request according to the name of the target translation file, where the preset request is used to request to obtain the target translation file;
[0085] Send a preset request to the file server.
[0086] As an implementation method of this embodiment, a preset request is generated according to the name of the target translation file. The preset request can be a simple HTTP request, including necessary parameters, such as the file name. The preset request is sent to the file server, so that the file server makes a corresponding response according to the content of the preset request.
[0087] Please refer to Figure 4, which is a specific embodiment of the data processing method provided by the present application. On the internationalization platform, the entries that need to be internationalized are collected and translated according to the business modules. After the translation is completed, the translated entries are output as translation entry files according to the business modules. If there are too many entries in a single business module, a new business module can be defined on the internationalization platform to further split the entries under the current business module. Each business module is uniformly named as "business module name + language abbreviation", and a complete translation entry file is output. Then the updated translation entry file is pushed to the file server, and a CDN refresh is performed to ensure that the online access translation entry file is the latest updated file. The file server is used to store translation entry files. After the translation entry file is pushed to the file server according to the business module, the file server performs an incremental update on the translation entry file instead of a full update. In this way, only the updated translation entry file needs to be pushed each time, reducing the number of file transfers and the number of files refreshed by the CDN.
[0088] This application splits the translation files and deploys them on the file server. The front-end page obtains the corresponding translation files on the server according to the business modules defined in the route. The release of translation entries does not depend on the release of the front-end local project, which improves the timeliness of translation updates and reduces the work of front-end developers to modify translation files. And by dividing the translation files into business modules, the size of a single translation file is reduced, and before the page is rendered, only the translation files of the corresponding modules are loaded, reducing the time and performance consumption caused by loading the full translation files for the first time into the page.
[0089] From the above, the data processing method of the embodiment of the present application obtains the first translation parameter of the front-end page, the first translation parameter includes at least the business type and the language type; determines the name of the target translation file according to the first translation parameter; obtains the target translation file corresponding to the name from the translation file of the file server, and the file server is used to store the translation files released by the internationalization platform. The embodiment of the present application separates the management and distribution of translation files, and uses the file server to store the classified translation files, thereby realizing efficient management and rapid distribution of translation files and improving the user experience.
[0090] Based on the same inventive concept as the above embodiments, an embodiment of the present invention provides an electronic device, such as Figure 5 As shown, the electronic device includes: a processor 310 and a memory 311 storing a computer program; wherein, Figure 5 The processor 310 shown in the figure is not used to indicate that the number of the processor 310 is one, but is only used to indicate the positional relationship of the processor 310 relative to other devices. In actual applications, the number of the processor 310 may be one or more; similarly, Figure 5The memory 311 shown in the figure has the same meaning, that is, it is only used to refer to the position relationship of the memory 311 relative to other devices. In practical applications, the number of memories 311 can be one or more. When the processor 310 runs the computer program, the method applied to the above device is implemented.
[0091] The electronic device may also include: at least one network interface 312. The various components in the electronic device are coupled together via a bus system 313. It is understood that the bus system 313 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 313 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 313 is not used in the following examples. Figure 5 Various buses are labeled as bus system 313.
[0092] The memory 311 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. The nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory may be a disk memory or a tape memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 311 described in the embodiments of the present invention is intended to include but is not limited to these and any other suitable types of memories.
[0093] The memory 311 in the embodiment of the present invention is used to store various types of data to support the operation of the electronic device. Examples of these data include: any computer program used to operate on the electronic device, such as an operating system and an application; contact data; phone book data; messages; pictures; videos, etc. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application program may include various applications, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. Here, the program that implements the method of the embodiment of the present invention may be included in the application program.
[0094] Based on the same inventive concept as the above-mentioned embodiment, this embodiment further provides a computer-readable storage medium, in which a computer program is stored. The computer-readable storage medium may be a ferromagnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); it may also be various devices including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc. When the computer program stored in the computer-readable storage medium is executed by the processor, the above method is implemented. For the specific steps implemented when the computer program is executed by the processor, please refer to Figure 1 The description of the illustrated embodiment will not be repeated here.
[0095] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0096] In this document, the terms "comprises," "comprising," or any other variations thereof, are intended to cover a non-exclusive inclusion of elements other than those listed and may also include additional elements not expressly listed.
[0097] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A data processing method, characterized in that: include: Acquire a first translation parameter of the front-end page, where the first translation parameter includes at least a business type and a language type; Determine the name of the target translation file according to the first translation parameter; A target translation file corresponding to the name is obtained from a translation file in a file server, where the file server is used to store translation files released by an internationalization platform.
2. The method according to claim 1, characterized in that The first translation parameter further includes at least one of a geographical area type, a user type, a function module type, a priority, and a release cycle. The determining the name of the target translation file according to the first translation parameter includes: The name of the target translation file is determined according to any one or a combination of multiple items in the first translation parameters.
3. The method according to claim 2, characterized in that The step of obtaining a target translation file corresponding to the name from a translation file in a file server includes: A target translation file corresponding to the name is obtained from an edge node of a content distribution network, where the content distribution network is used to cache the translation files of the file server.
4. The method according to claim 3, characterized in that The method further comprises: In response to the incremental update of the file server, the translation file cached on the edge node of the content distribution network is refreshed, wherein the incremental update of the file server refers to the internationalization platform pushing the updated translation file to the file server.
5. The method according to claim 1, characterized in that After obtaining the target translation file corresponding to the name from the translation file of the file server, the method further includes: The target translation file is stored based on a state management tool.
6. The method according to claim 1, characterized in that The method further comprises: In response to refreshing the front-end page, obtaining a second translation parameter of the front-end page; If the second translation parameter is different from the first translation parameter, the target translation file is obtained again according to the second translation parameter.
7. The method according to claim 6, characterized in that The step of obtaining the target translation file again according to the second translation parameter includes: Determine the name of the target translation file according to the first translation parameter; If the target translation file is already stored locally, obtaining the locally stored target translation file; If the target translation file is not stored locally, the target translation file corresponding to the name is obtained from the translation file in the file server.
8. The method according to claim 1, characterized in that Before obtaining the target translation file corresponding to the name from the translation file of the file server, the method further includes: Generate a preset request according to the name of the target translation file, wherein the preset request is used to request to obtain the target translation file; Sending the preset request to the file server.
9. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the method according to any one of claims 1 to 8 when executed by the processor.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Cited By
Enterprise application internationalization method and device based on meta-model context awareness, equipment and storage medium
CN121579123A