Localisation and Internationalisation Flashcards
Q: What is localization in WordPress?
A: Localization is the process of adapting a website to a specific language, culture, or locale by translating content and formatting.
Q: What is internationalization in WordPress?
A: Internationalization is the process of preparing a website or application for localization by making it adaptable to different languages and regions.
Q: What is a locale?
A: A locale is a set of parameters defining a language, country, and regional preferences (e.g., en_US for English - United States).
Q: What is the difference between localization and internationalization?
A: Internationalization refers to making a site translation-ready, while localization is the actual process of translating and adapting the site.
Q: What is a .po file in WordPress?
A: A .po file (Portable Object) contains the translatable strings and their translations.
Q: What is a .mo file in WordPress?
A: A .mo file (Machine Object) is the compiled version of the .po file, used by WordPress to display translations.
Q: What is the purpose of the gettext function in WordPress?
A: It retrieves translated strings for use in the site, enabling localization.
Q: What is the difference between _e() and __() in WordPress?
A: _e() echoes the translated string directly, while __() returns the translated string for further use.
Q: What is the load_textdomain() function used for?
A: It loads a specific text domain for translations in WordPress.
Q: What is a text domain in WordPress?
A: A unique identifier for translation files associated with a theme or plugin.
Q: How do you mark a string for translation in WordPress?
A: Use functions like __(), _e(), _x(), or _n().
Q: What is the purpose of the _n() function in WordPress?
A: It handles plural forms in translations, allowing proper localization of singular and plural strings.
Q: What tools can you use to create .po and .mo files?
A: Tools like Poedit, Loco Translate, or the WordPress CLI.
Q: How do you generate a .pot file for a theme or plugin?
A: Use xgettext or plugins like Loco Translate to extract translatable strings into a .pot file.
Q: Where should translation files for themes be stored?
A: In the /languages/ folder of the theme or in /wp-content/languages/themes/.
Q: Where should translation files for plugins be stored?
A: In the /languages/ folder of the plugin or /wp-content/languages/plugins/.
Q: Name three popular WordPress plugins for multilingual websites.
A: WPML (WordPress Multilingual Plugin), Polylang, and TranslatePress.