語言和翻譯

語言和翻譯

Codex Home → Languages and Translations
Languages and Translations

Like WordPress, BuddyPress has the built in capability to be used in any language. The instructions below assume you have already configured WordPress in Your Language and Installing WordPress in Your Language.
Like WordPress, you don』t have to lift a finger to apply BuddyPress translations or translation updates. Most sites are now able to automatically apply these updates in the background. If your site is capable of one-click updates without entering FTP credentials, then your site should be able to automatically update translations.
Official BuddyPress translation files (buddypress-xx_XX.po/mo) are loaded to wp-content/languages/plugins/.
Note: the buddypress.pot file provided with each new update is not a translation, but only the translatable strings catalog.
Is your language missing?
BuddyPress translation packages are only updated if the translation is at 100% translated, if you do not see your language after updating your translations, please consider contributing to the the BuddyPress translation project, to get started see Translating WordPress and post any questions you have on the WordPress Polyglots blog.
Manually overriding the translations
1. Get latest (stable) version of BuddyPress and dev
Go to https://translate.wordpress.org/projects/wp-plugins/buddypress and select your preferred language e.g. Portuguese (Brazil)
Select 'Stable (latest release)' or 'Development (trunk)'.
Select 'all current' as '.po' and click 『Export』 and save this file to a folder on your computer, do the same again this time selecting '.mo'
Rename each file to buddypress-language_COUNTRY.extension
eg.
wp-plugins-buddypress-stable-pt-br.po to buddypress-pt_BR.po and
wp-plugins-buddypress-stable-pt-br.mo to buddypress-pt_BR.mo
2. How to use custom language files
You can use your own translation version to fit your needs. Add it to /wp-content/languages/buddypress/. This new directory will not be automatically updated, so it is a safe place to store your custom work. BuddyPress will check for this directory as first. If nothing is found, it will use the translation stored wp-content/languages/plugins/. You can use both directories, so you will never miss an official translation and continue to use your own one. Simply remind to control your work after each BuddyPress update, with help of the buddypress.pot file.
Upload as described or copy the translation files from wp-content/languages/plugins/ to /wp-content/languages/buddypress/.
To create or modify a custom translation you need to use a translation tool, like poEdit or similar, to generate a compiled .mo file.
If the /wp-content/languages/ or /wp-content/languages/plugins/ or /wp-content/languages/buddypress/ folders do not exist, create them.
Using FTP upload both the .po and .mo files to of your WordPress installation.

發表回覆

您的電子郵箱地址不會被公開。 必填項已用 * 標註