CN111177634A - Multi-language supporting file content loading method, device, equipment and medium - Google Patents
Multi-language supporting file content loading method, device, equipment and medium Download PDFInfo
- Publication number
- CN111177634A CN111177634A CN202010006179.7A CN202010006179A CN111177634A CN 111177634 A CN111177634 A CN 111177634A CN 202010006179 A CN202010006179 A CN 202010006179A CN 111177634 A CN111177634 A CN 111177634A
- Authority
- CN
- China
- Prior art keywords
- language
- document
- variable
- page file
- display language
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000011068 loading method Methods 0.000 title claims abstract description 37
- 238000000034 method Methods 0.000 claims abstract description 37
- 238000009877 rendering Methods 0.000 claims abstract description 16
- 238000004590 computer program Methods 0.000 claims description 9
- 238000012545 processing Methods 0.000 claims description 8
- 238000010586 diagram Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
- G06F16/986—Document structures and storage, e.g. HTML extensions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
- G06F9/454—Multi-language systems; Localisation; Internationalisation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Human Computer Interaction (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the disclosure discloses a method, a device, equipment and a medium for loading file contents supporting multiple languages, wherein the method comprises the following steps: acquiring a page file containing a file variable from a server, wherein the page file carries an indication code; according to the indication code, the following operations are executed: determining a pre-display language; acquiring a language package corresponding to the pre-display language; and acquiring the document content corresponding to the document variable from the language package and rendering the document variable corresponding to the document to be loaded in the page file. The technical scheme of the embodiment can keep the consistency of the documentations in the webpage, and is convenient for modifying and updating the documentations.
Description
Technical Field
The embodiment of the disclosure relates to the field of computer network application, in particular to a method, a device, equipment and a medium for loading file contents supporting multiple languages.
Background
The pages and forms of the application programs and the websites relate to text elements, prompt information (such as error prompts) and other document contents, and in order to realize product internationalization, the documents of the pages need to support multiple languages, and multiple language modes need to be provided so as to adapt to users in different areas.
In the existing method, each WEB page writes an HTML file for each national language, and the HTML file of the corresponding national language is reloaded when the languages are switched.
By adopting the mode, on one hand, the webpage content is bloated and inflexible; on the other hand, the code maintenance is not facilitated, and the file modification is very inconvenient.
Disclosure of Invention
In view of this, the embodiments of the present disclosure provide a method, an apparatus, a device, and a medium for loading document contents supporting multiple languages, so as to maintain consistency of documents in a web page and facilitate modification and update of documents.
Additional features and advantages of the disclosed embodiments will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosed embodiments.
In a first aspect, an embodiment of the present disclosure provides a method for loading document contents supporting multiple languages, including:
acquiring a page file containing a file variable from a server, wherein the page file carries an indication code;
according to the indication code, the following operations are executed:
determining a pre-display language;
acquiring a language package corresponding to the pre-display language;
and acquiring the document content corresponding to the document variable from the language package and rendering the document variable corresponding to the document to be loaded in the page file.
In a second aspect, an embodiment of the present disclosure further provides a device for loading document content supporting multiple languages, where the device includes:
the system comprises a page file acquisition unit, a page file processing unit and a page file processing unit, wherein the page file acquisition unit is used for acquiring a page file containing a file case variable from a server, and the page file carries an indication code;
a code execution unit for executing the instruction code, the code execution unit comprising:
a language determining subunit, configured to determine a pre-display language;
the language pack acquisition subunit is used for acquiring a language pack corresponding to the pre-display language;
and the document content obtaining and rendering subunit is used for obtaining and rendering the document content corresponding to the document variable from the language package for the document variable corresponding to the document to be loaded in the page file.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, including:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the instructions of the method of any one of the first aspects.
In a fourth aspect, the disclosed embodiments also provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of the method according to any one of the first aspect.
According to the embodiment of the disclosure, the browsing client side obtains the page file containing the document variables from the server side, the indication code embedded in the page file is executed to determine the pre-display language of the browsing client side, then the language package corresponding to the pre-display language is obtained, and the document contents corresponding to the document variables are obtained from the language package and rendered, so that the consistency of the documents in the webpage can be maintained, and the documents can be modified and updated conveniently.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings needed to be used in the description of the embodiments of the present disclosure will be briefly described below, and it is obvious that the drawings in the following description are only a part of the embodiments of the present disclosure, and for those skilled in the art, other drawings can be obtained according to the contents of the embodiments of the present disclosure and the drawings without creative efforts.
FIG. 1 is a flowchart illustrating a method for loading document contents supporting multiple languages according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a Chinese language package according to an embodiment of the disclosure;
fig. 3 is a schematic diagram of an english language package provided by an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating another method for loading document contents supporting multiple languages according to an embodiment of the present disclosure;
FIG. 5 is a schematic structural diagram of a device for loading document contents supporting multiple languages according to an embodiment of the present disclosure;
FIG. 6 shows a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
In order to make the technical problems solved, technical solutions adopted and technical effects achieved by the embodiments of the present disclosure clearer, the technical solutions of the embodiments of the present disclosure will be described in further detail below with reference to the accompanying drawings, and it is obvious that the described embodiments are only some embodiments, but not all embodiments, of the embodiments of the present disclosure. All other embodiments, which can be obtained by a person skilled in the art without making creative efforts based on the embodiments of the present disclosure, belong to the protection scope of the embodiments of the present disclosure.
It should be noted that the terms "system" and "network" are often used interchangeably in the embodiments of the present disclosure. Reference to "and/or" in embodiments of the present disclosure is meant to include any and all combinations of one or more of the associated listed items. The terms "first", "second", and the like in the description and claims of the present disclosure and in the drawings are used for distinguishing between different objects and not for limiting a particular order.
It should also be noted that, in the embodiments of the present disclosure, each of the following embodiments may be executed alone, or may be executed in combination with each other, and the embodiments of the present disclosure are not limited specifically.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The technical solutions of the embodiments of the present disclosure are further described by the following detailed description in conjunction with the accompanying drawings.
Fig. 1 is a schematic flowchart illustrating a method for loading document contents supporting multiple languages according to an embodiment of the present disclosure, where the embodiment is applicable to a case where a browsing client loads a web page and obtains document contents according to document variables for rendering, and the method may be executed by a device configured in an electronic device and supporting multiple languages, as shown in fig. 1, the method for loading document contents supporting multiple languages according to the embodiment includes:
in step S110, a page file containing the document variable is obtained from the server, where the page file carries an indication code.
The indication code is a code suitable for a web page, such as a script code, where the programming language used by the script code may be various, and the embodiment does not limit the specific language, such as a code written in JavaScript or VBScript.
On the other hand, the specific form of the indication code is also not limited in this embodiment, and may be, for example, embedded in a page, or an external script file introduced into the page. The embedded type html event is embedded in a page, an html element event or a 'sctip' element.
The browsing client executes the following operations of steps S120-S140 according to the indication code.
In step S120, a pre-display language is determined.
The kind of the display language is determined according to the applicable region of the product, such as English, Chinese, German, etc.
The determining mode of the pre-display language can adopt various modes, for example, configuration information of a browsing client can be acquired, and the pre-display language of the browsing client is determined according to the configuration information.
For another example, if the page file or the application in which the page file is located has an input component for the user to select an applicable language, the pre-display language of the browsing client may be determined according to the input information of the user in the input component.
For another example, if the derived information of the indication code includes setting information of an applicable language, the pre-display language of the browsing client may be determined according to the setting information derived from the indication code.
In step S130, a language package corresponding to the pre-display language is obtained.
For example, fig. 2 is a schematic diagram of a chinese language pack provided by the embodiment of the present disclosure, and fig. 3 is a schematic diagram of an english language pack provided by the embodiment of the present disclosure. The Key value is a document variable, namely an ID identifier of a document, and can be represented by a numerical value or a character string. Value is the corresponding file content, different language packages, different file content.
It should be noted that what storage form is specifically adopted for the language package corresponding to the pre-display language is only required to be able to find the corresponding language document according to the document variable, and this embodiment does not limit this, and for example, the language package may be stored as data in the JSON format, where a name of a JSON object in the data in the JSON format is the document variable, and a value of the JSON object is the document content of the pre-display language corresponding to the document variable, that is, the JSON object may be searched through the document variable, so as to obtain the document content according to the value of the JSON object.
In step S140, for the document variable corresponding to the document to be loaded in the page file, the document content corresponding to the document variable is obtained from the language package and rendered.
In the embodiment, the client acquires the page file containing the document variables from the server, executes the instruction codes embedded in the page file to determine the pre-display language of the browsing client, acquires the language package corresponding to the pre-display language, and acquires and renders the document contents corresponding to the document variables from the language package, so that the consistency of the documents in the web page can be maintained, and the documents can be modified and updated conveniently.
Fig. 4 is a schematic flow chart of another method for loading document contents supporting multiple languages according to an embodiment of the present disclosure, which is based on the foregoing embodiment and is optimized. As shown in fig. 4, the method for loading document contents supporting multiple languages in this embodiment includes:
in step S410, a page file containing the document variable is obtained from the server, where the page file carries an indication code.
The client performs the following operations of steps S420-S440 according to the indication code.
In step S420, a pre-display language is determined according to the setting information derived from the indication code.
It should be noted that, the determining of the pre-display language of the browsing client may be performed in various manners, for example, configuration information of the browsing client may be obtained, and the pre-display language of the browsing client is determined according to the configuration information.
For another example, if the page file or the application in which the page file is located has an input component for the user to select an applicable language, the pre-display language of the browsing client may be determined according to the input information of the user in the input component.
The present embodiment discloses a method for determining a pre-display language of the browsing client, for example, by determining the pre-display language of the browsing client according to the setting information derived from the indication code.
In step S430, the language package corresponding to the pre-display language is obtained locally, and the language package corresponding to the pre-display language is requested to replace the local language package from the server.
It should be noted that, in the process of loading the web page by the browsing client, a connection needs to be established with the server to request the server for the language package corresponding to the pre-display language. If the network between the server side and the webpage is blocked, the webpage loading process is influenced. Therefore, this embodiment discloses a technical solution, where the browsing client is controlled to obtain the language package corresponding to the pre-display language from the local, so as to execute step S450, and meanwhile, the server is requested to replace the local language package of the browsing client with the language package corresponding to the pre-display language, and then step S440 is executed in a reloading manner, so that the user can see the page effect as soon as possible.
In step S440, for the document variable corresponding to the document to be loaded in the page file, the document content corresponding to the document variable is obtained from the language package and rendered.
On the basis of the previous embodiment, when the language package corresponding to the pre-display language is acquired, the language package corresponding to the pre-display language is locally acquired from the browsing client, and meanwhile, the language package corresponding to the pre-display language is requested to the server to replace the local language package of the browsing client, so that the local language package is used in advance to acquire the page document content, and then the language package requested from the server is used to reload and render the document content, so that the user can see the page effect as soon as possible, the user experience can be improved, and the problem of overlong loading time caused by network congestion can be solved.
As an implementation of the methods shown in the above figures, the present application provides an embodiment of a loading apparatus for multiple language-supported document content, and fig. 5 is a schematic structural diagram of a loading apparatus for multiple language-supported document content provided in this embodiment, where the loading apparatus is configured in a browsing client, and the embodiment of the loading apparatus corresponds to the embodiment of the methods shown in fig. 1 to fig. 4, and the loading apparatus can be applied to various electronic devices. As shown in fig. 5, the apparatus for loading document contents supporting multiple languages according to the present embodiment includes a page file obtaining unit 510 and a code executing unit 520. Wherein the code execution unit 520 includes a language determination subunit 521, a language pack acquisition subunit 522, and a document content acquisition and rendering subunit 523.
The page file obtaining unit 510 is configured to obtain a page file containing a document variable from a server, where the page file carries an indication code;
the code execution unit 520 is configured to execute the instruction code, and includes a language determination subunit 521, a language pack acquisition subunit 522, and a document content acquisition and rendering subunit 523.
The language determination subunit 521 is configured to determine a pre-display language of the browsing client.
The language pack acquiring subunit 522 is configured to acquire a language pack corresponding to the pre-display language.
The copy content obtaining and rendering subunit 523 is configured to, for a copy variable corresponding to a copy to be loaded in the page file, obtain, from the language package, a copy content corresponding to the copy variable, and render the copy content.
In an embodiment, the language package obtaining subunit 522 is configured to obtain the language package corresponding to the pre-display language locally from the browsing client, and simultaneously request the language package corresponding to the pre-display language to replace the language package local to the browsing client from the server.
In an embodiment, the language pack obtaining subunit 522 is further configured to obtain, after obtaining and rendering the document content corresponding to the document variable from the language pack, the language pack corresponding to the pre-display language from the local by means of reloading.
In an embodiment, the language determining subunit 521 is configured to determine a pre-display language of the browsing client according to the setting information derived from the indication code.
In an embodiment, the indication code is a JavaScript code.
In an embodiment, the language package corresponding to the pre-display language is data in JSON format, where a name of a JSON object in the data in JSON format is a document variable, and a value of the JSON object is document content of the pre-display language corresponding to the document variable.
The multilingual-supported document content loading apparatus provided in this embodiment can execute the multilingual-supported document content loading method provided in the embodiment of the present disclosure, and has functional modules and beneficial effects corresponding to the execution method.
Referring now to FIG. 6, a block diagram of an electronic device 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium described above in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the disclosed embodiments, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the disclosed embodiments, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to:
the method comprises the steps that a browsing client side obtains a page file containing a file variable from a server side, wherein the page file carries an indication code;
the browsing client executes the following operations according to the indication code:
determining a pre-display language of the browsing client;
acquiring a language package corresponding to the pre-display language;
and acquiring the document content corresponding to the document variable from the language package and rendering the document variable corresponding to the document to be loaded in the page file.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
According to one or more embodiments of the present disclosure, in the method for loading the document content supporting multiple languages, the obtaining of the language package corresponding to the pre-display language includes:
and acquiring the language package corresponding to the pre-display language from the local, and simultaneously requesting the language package corresponding to the pre-display language to replace the local language package from the server.
According to one or more embodiments of the present disclosure, in the method for loading document contents supporting multiple languages, after obtaining and rendering document contents corresponding to the document variables from the language pack, the method further includes: and acquiring the language package corresponding to the pre-display language from the local place in a reloading mode.
According to one or more embodiments of the present disclosure, the determining of the pre-display language includes:
and determining a pre-display language according to the setting information derived from the indication code.
According to one or more embodiments of the present disclosure, in the multilingual-supporting document content loading method, the indication code is a JavaScript code.
According to one or more embodiments of the present disclosure, in the multilingual-supported document content loading method, the language package corresponding to the pre-display language is data in a JSON format, where a name of a JSON object in the data in the JSON format is a document variable, and a value of the JSON object is the document content of the pre-display language corresponding to the document variable.
According to one or more embodiments of the present disclosure, in the multilingual-enabled document content loading apparatus, the language pack acquiring subunit is configured to:
and acquiring the language package corresponding to the pre-display language from the local, and simultaneously requesting the language package corresponding to the pre-display language to replace the local language package from the server.
According to one or more embodiments of the present disclosure, in the multilingual-enabled document content loading apparatus, in the multilingual-enabled document content loading method, the language package obtaining subunit is further configured to obtain the language package corresponding to the pre-display language from a local place in a reloading manner after obtaining the document content corresponding to the document variable from the language package and rendering the document content.
According to one or more embodiments of the present disclosure, in the multilingual-enabled document content loading apparatus, the determining a pre-display language includes: and determining a pre-display language according to the setting information derived from the indication code.
According to one or more embodiments of the present disclosure, in the multilingual-enabled document content loading apparatus, the indication code is a JavaScript code.
According to one or more embodiments of the present disclosure, in the multilingual-supported document content loading apparatus, the language package corresponding to the pre-display language is data in a JSON format, where a name of a JSON object in the data in the JSON format is a document variable, and a value of the JSON object is the document content of the pre-display language corresponding to the document variable.
The foregoing description is only a preferred embodiment of the disclosed embodiments and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure in the embodiments of the present disclosure is not limited to the particular combination of the above-described features, but also encompasses other embodiments in which any combination of the above-described features or their equivalents is possible without departing from the scope of the present disclosure. For example, the above features and (but not limited to) the features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.
Claims (9)
1. A file content loading method supporting multiple languages is characterized by comprising the following steps:
acquiring a page file containing a file variable from a server, wherein the page file carries an indication code;
according to the indication code, the following operations are executed:
determining a pre-display language;
acquiring a language package corresponding to the pre-display language;
and acquiring the document content corresponding to the document variable from the language package and rendering the document variable corresponding to the document to be loaded in the page file.
2. The method of claim 1, wherein obtaining the language pack corresponding to the pre-display language comprises:
and acquiring the language package corresponding to the pre-display language from the local, and simultaneously requesting the language package corresponding to the pre-display language to replace the local language package from the server.
3. The method of claim 2, wherein after obtaining and rendering the document content corresponding to the document variable from the language pack, further comprising:
and acquiring the language package corresponding to the pre-display language from the local place in a reloading mode.
4. The method of claim 1, wherein determining the pre-display language comprises:
and determining a pre-display language according to the setting information derived from the indication code.
5. The method of claim 1, wherein the indication code is JavaScript code.
6. The method according to claim 5, wherein the language package corresponding to the pre-display language is data in JSON format, wherein the name of a JSON object in the JSON format data is a document variable, and the value of the JSON object is the document content of the pre-display language corresponding to the document variable.
7. A device for loading document contents supporting multiple languages, comprising:
the system comprises a page file acquisition unit, a page file processing unit and a page file processing unit, wherein the page file acquisition unit is used for acquiring a page file containing a file case variable from a server, and the page file carries an indication code;
a code execution unit for executing the instruction code, the code execution unit comprising:
a language determining subunit, configured to determine a pre-display language;
the language pack acquisition subunit is used for acquiring a language pack corresponding to the pre-display language;
and the document content obtaining and rendering subunit is used for obtaining and rendering the document content corresponding to the document variable from the language package for the document variable corresponding to the document to be loaded in the page file.
8. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010006179.7A CN111177634A (en) | 2020-01-03 | 2020-01-03 | Multi-language supporting file content loading method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010006179.7A CN111177634A (en) | 2020-01-03 | 2020-01-03 | Multi-language supporting file content loading method, device, equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111177634A true CN111177634A (en) | 2020-05-19 |
Family
ID=70654470
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010006179.7A Pending CN111177634A (en) | 2020-01-03 | 2020-01-03 | Multi-language supporting file content loading method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111177634A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112817655A (en) * | 2021-01-29 | 2021-05-18 | 北京达佳互联信息技术有限公司 | Document information processing method, device, storage medium and electronic equipment |
CN114371905A (en) * | 2022-01-14 | 2022-04-19 | 武汉源启科技股份有限公司 | Page rendering method and device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130091425A1 (en) * | 2011-10-10 | 2013-04-11 | Shannon Ray Hughes | Server-side internationalization and localization of web applications using a scripting language |
CN105868320A (en) * | 2016-03-25 | 2016-08-17 | 乐视控股(北京)有限公司 | Display method, device and system |
CN108984170A (en) * | 2017-06-02 | 2018-12-11 | 阿里巴巴集团控股有限公司 | The multilingual rendering method of the H5 page and device |
CN109947512A (en) * | 2019-03-18 | 2019-06-28 | 北京字节跳动网络技术有限公司 | A kind of text adaptation display methods, device, server and storage medium |
CN110536149A (en) * | 2019-09-02 | 2019-12-03 | 北京字节跳动网络技术有限公司 | Message display method, device, readable medium and electronic equipment |
-
2020
- 2020-01-03 CN CN202010006179.7A patent/CN111177634A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130091425A1 (en) * | 2011-10-10 | 2013-04-11 | Shannon Ray Hughes | Server-side internationalization and localization of web applications using a scripting language |
CN105868320A (en) * | 2016-03-25 | 2016-08-17 | 乐视控股(北京)有限公司 | Display method, device and system |
CN108984170A (en) * | 2017-06-02 | 2018-12-11 | 阿里巴巴集团控股有限公司 | The multilingual rendering method of the H5 page and device |
CN109947512A (en) * | 2019-03-18 | 2019-06-28 | 北京字节跳动网络技术有限公司 | A kind of text adaptation display methods, device, server and storage medium |
CN110536149A (en) * | 2019-09-02 | 2019-12-03 | 北京字节跳动网络技术有限公司 | Message display method, device, readable medium and electronic equipment |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112817655A (en) * | 2021-01-29 | 2021-05-18 | 北京达佳互联信息技术有限公司 | Document information processing method, device, storage medium and electronic equipment |
CN112817655B (en) * | 2021-01-29 | 2024-05-14 | 北京达佳互联信息技术有限公司 | Document information processing method and device, storage medium and electronic equipment |
CN114371905A (en) * | 2022-01-14 | 2022-04-19 | 武汉源启科技股份有限公司 | Page rendering method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110046021B (en) | Page display method, device, system, equipment and storage medium | |
CN109857486B (en) | Method, device, equipment and medium for processing program page data | |
CN110865852B (en) | Webpage component loading method and device, electronic equipment and storage medium | |
CN113157153A (en) | Content sharing method and device, electronic equipment and computer readable storage medium | |
CN111273985A (en) | Page rendering method and device, electronic equipment and computer readable storage medium | |
CN115470432A (en) | Page rendering method and device, electronic equipment and computer readable medium | |
CN111694629A (en) | Information display method and device and electronic equipment | |
CN111177634A (en) | Multi-language supporting file content loading method, device, equipment and medium | |
CN111258800A (en) | Page processing method and device and electronic equipment | |
CN110765386A (en) | Webpage image monitoring method and device, electronic equipment and readable storage medium | |
CN111783010B (en) | Webpage blank page monitoring method, device, terminal and storage medium | |
CN112579218B (en) | User interface display method and device, computer readable medium and electronic equipment | |
CN110618811B (en) | Information presentation method and device | |
CN111324835A (en) | Method and device for rendering user interface component, electronic equipment and storage medium | |
CN109857503B (en) | Page interaction effect self-adaption method and device and electronic equipment | |
CN112256370A (en) | Information display method and device and electronic equipment | |
CN110147283B (en) | Display content switching display method, device, equipment and medium | |
CN110619101B (en) | Method and apparatus for processing information | |
CN111309406A (en) | Event processing method and device of application program and electronic equipment | |
CN110717126A (en) | Page browsing method and device, electronic equipment and computer readable storage medium | |
CN111290812B (en) | Display method, device, terminal and storage medium of application control | |
CN114090938A (en) | Page processing method and equipment | |
CN114489902A (en) | Interface display method, device, equipment and medium | |
CN113296771A (en) | Page display method, device, equipment and computer readable medium | |
CN112445478A (en) | Graphic file processing method, device, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200519 |