Internationalisation (i18n) and Localisation (i10n) Flashcards
Q: What does internationalisation (i18n) mean?
A: Preparing a WordPress theme or plugin to support translation into different languages.
Q: What does localisation (l10n) mean?
A: Translating text and adapting other locale-specific elements for a specific region or language.
Q: What is a .POT file?
A: A Portable Object Template file used as a template for translations.
Q: What is a .PO file?
A: A Portable Object file that contains the actual translations.
Q: What is a .MO file?
A: A Machine Object file, a compiled version of the .PO file used by WordPress.
Q: What is the purpose of __()?
A: To translate and return a string.
Q: What is _e() used for?
A: To translate and echo a string.
Q: What does _n() do?
A: Handles plural translations for a given string.
Q: What is the esc_html__() function used for?
A: To translate and escape HTML output for safe display.
Q: What is the esc_attr__() function used for?
A: To translate and escape a string for use in HTML attributes.
Q: What is a text domain in WordPress?
A: A unique identifier for grouping translations in a plugin or theme.
Q: Where do you define the text domain for a theme?
A: In the theme’s style.css file under the Text Domain header.
Q: Where do you define the text domain for a plugin?
A: In the plugin’s main file within the plugin header comment.
Q: What is the purpose of the load_textdomain() function?
A: To load a text domain for translations.
Q: How do you load translations for a theme?
A: Use load_theme_textdomain().
Q: What directory is used for language files in a theme?
A: /wp-content/themes/your-theme-name/languages/.