Micro-front-end-based page internationalization configuration method and apparatus, device, and medium
AssigneeSuzhou Metabrain Intelligent Technology Co., Ltd.
InventorLei Xu
Life of this patent
Estimating the term…
Abstract
The present application relates to the technical field of computers, and discloses a micro-front-end-based page internationalization configuration method and apparatus, a device and a medium. The method includes: creating an internationalized page in a micro-front-end main application, and configuring the internationalized page to obtain a configured internationalized page; persisting data in the configured internationalized page; and reading the data and transmitting the data to at least one micro-front-end sub-application for any one of the micro-front-end sub-applications to perform page translation according to the data.
Claims16
A micro-front-end-based page internationalization configuration method, wherein the method comprises:
- creating an internationalized page in a micro-front-end main application;
- acquiring at least one entry from the internationalized page, and configuring a plurality of attributes to each of the at least one entry, wherein the plurality of attributes comprise a keyword and at least one language translation data, the keyword is configured for identifying a current entry, and the keyword is globally unique;
- obtaining a configured internationalized page;
- persisting data in the configured internationalized page;
- and
- reading the data and transmitting the data to at least one micro-front-end sub-application for any one of the at least one micro-front-end sub-application to perform page translation according to the data;
- wherein after the persisting data in the configured internationalized page, the method further comprises:
- determining whether a browser is refreshed or whether a page is reloaded;
- in response to a determination that the browser is refreshed or the page is reloaded, determining system initialization;
- reading all the data in the micro-front-end main application in response to the system initialization;
- recognizing a current language environment;
- converting, according to the current language environment, a format of each of the at least one entry to filter out attribute data information of other language environments to obtain corresponding language translation data of each of the at least one entry;
- and
- combining the keyword with the corresponding language translation data of each of the at least one entry to obtain combined entry data.
An electronic device, comprising a memory and a processor and a computer program stored in the memory that is executed by the processor, wherein the processor, when executing the computer program, is configured to execute a micro-front-end-based page internationalization configuration method, comprising:
- creating an internationalized page in a micro-front-end main application;
- acquiring at least one entry from the internationalized page, and configuring a plurality of attributes to each of the at least one entry, wherein the plurality of attributes comprise a keyword and at least one language translation data, the keyword is configured for identifying a current entry, and the keyword is globally unique;
- obtaining a configured internationalized page;
- persisting data in the configured internationalized page;
- and
- reading the data and transmitting the data to at least one micro-front-end sub-application for any one of the at least one micro-front-end sub-application to perform page translation according to the data;
- wherein the processor, when executing the computer program, is configured to execute after the persisting data in the configured internationalized page, further operations comprising:
- determining whether a browser is refreshed or whether a page is reloaded;
- in response to a determination that the browser is refreshed or the page is reloaded, determining system initialization;
- reading all the data in the micro-front-end main application in response to the system initialization;
- recognizing a current language environment;
- converting, according to the current language environment, a format of each of the at least one entry to filter out attribute data information of other language environments to obtain corresponding language translation data of each of the at least one entry;
- and
- combining the keyword with the corresponding language translation data of each of the at least one entry to obtain combined entry data.
A non-transitory computer-readable storage media, storing computer-readable instructions, wherein the computer-readable instructions are configured to execute a micro-front-end-based page internationalization configuration method, comprising:
- creating an internationalized page in a micro-front-end main application;
- acquiring at least one entry from the internationalized page, and configuring a plurality of attributes to each of the at least one entry, wherein the plurality of attributes comprise a keyword and at least one language translation data, the keyword is configured for identifying a current entry, and the keyword is globally unique;
- obtaining a configured internationalized page;
- persisting data in the configured internationalized page;
- and
- reading the data and transmitting the data to at least one micro-front-end sub-application for any one of the at least one micro-front-end sub-application to perform page translation according to the data;
- wherein the computer-readable instructions are configured to execute after the persisting data in the configured internationalized page, further operations comprising:
- determining whether a browser is refreshed or whether a page is reloaded;
- in response to a determination that the browser is refreshed or the page is reloaded, determining system initialization;
- reading all the data in the micro-front-end main application in response to the system initialization;
- recognizing a current language environment;
- converting, according to the current language environment, a format of each of the at least one entry to filter out attribute data information of other language environments to obtain corresponding language translation data of each of the at least one entry;
- and
- combining the keyword with the corresponding language translation data of each of the at least one entry to obtain combined entry data.
Dependencies are inferred from the claim text.