tailieunhanh - Creating Applications with Mozilla-Chapter 11. Localization-P2

Tham khảo tài liệu 'creating applications with mozilla-chapter 11. localization-p2', công nghệ thông tin, quản trị web phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 11. Localization-P2 As you can see from their names and their locations in the chrome each bundle serves a different purpose. They include a file that contains the bulk of the strings for the browser a file that includes branding strings and a couple of files for regional information. This model is useful if you need to output many strings to the UI from your source code and would like to organize them into meaningful groups. . Inside a Bundle A string bundle .properties file has a very simple format. It contains one or more lines that have the identifier associated with the localizable string. The format of a string bundle string with an identifier is Identifier String The format for comments in a bundle file requires the hash notation . Comments are useful for notifying translators of the context of strings or flagging a string that should be left as is and not localized. Comments in properties files are formatted in the following manner. DO NOT TRANSLATE applicationTitle xFly Spaces in bundles are treated literally -- spaces between words are observed with the exception of the start and the end of the string. The next section shows the methods and properties specific to the stringbundle element that are available to you when you use it. The implementations are contained in the binding for the element. . String Bundle Methods and Properties Defining your bundle in XUL and then creating the file with the values is only half the story. This section shows how to extract the values from the bundle and place them in UI. The language of choice in these examples is JavaScript. This process is necessary when you have to change values in the UI because DTD entities can not be updated dynamically. . Methods Our bundle is defined in XUL like this stringbundle id bundle_xfly src chrome xfly locale To access the methods of the bundle object in your script you have to get a handle on the XUL element by using its

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.