Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Thêm một bình luận vào tập tin readme của chủ đề của bạn về sự sẵn có của tập tin PO, và chỉ rõ rằng chủ đề của bạn là chuẩn bị cho dịch thuật và nội địa hóa. Bạn cũng có thể muốn thêm một tập tin readme thêm trong thư mục bản dịch của bạn mô tả mục đích của tập tin PO. | Chapter 11 Check your po file. It should have each text string block formatted like the following example which shows the text string Dashboard from the administration panel along with a comment block directly above it that describes where the text string is located within the template wp-admin menu.php 10 msgid Dashboard msgstr Add a comment to the readme file of your theme about the availability of the po file and specifying that your theme is prepared for translation and localization. You may also want to add an additional readme file in your translation folder that describes the purpose of the po file. Now that the template has been localized you will need to add a tag to either your functions.php file or header.php file so that any translated text will be loaded if desired by the user. Open up or create a functions.php file and add the following code contained within PHP tags where themename is the name of your theme folder on your server Translate if applicable load_theme_textdomain themename As an extra step you can also create your own localization files. Open your po file and augment the msgstr for each item so that it now contains the translated text. Following is an example of the text string Dashboard translated to Spanish wp-admin menu.php 10 msgid Dashboard msgstr Tablero de instrumentos Save the file with the extension .po within your translation folder using the language abbreviation as the file name. For example if your .po file is in Spanish it would usually be called es_ES.po where the lowercase text represents the dialect or regional language and the uppercase text represents the core language abbreviation. The .po file now needs to be formatted as an .mo Machine Object file in order for the text to be properly read by the server side GetText translation utility used by WordPress. You can download the free editor POEdit from http www.poedit.net so that you can make any additional translation changes and then save the file in .mo format. Next you