Localisation and Internationalisation Flashcards

1
Q

Q: What is localization in WordPress?

A

A: Localization is the process of adapting a website to a specific language, culture, or locale by translating content and formatting.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Q: What is internationalization in WordPress?

A

A: Internationalization is the process of preparing a website or application for localization by making it adaptable to different languages and regions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Q: What is a locale?

A

A: A locale is a set of parameters defining a language, country, and regional preferences (e.g., en_US for English - United States).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Q: What is the difference between localization and internationalization?

A

A: Internationalization refers to making a site translation-ready, while localization is the actual process of translating and adapting the site.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Q: What is a .po file in WordPress?

A

A: A .po file (Portable Object) contains the translatable strings and their translations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Q: What is a .mo file in WordPress?

A

A: A .mo file (Machine Object) is the compiled version of the .po file, used by WordPress to display translations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Q: What is the purpose of the gettext function in WordPress?

A

A: It retrieves translated strings for use in the site, enabling localization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Q: What is the difference between _e() and __() in WordPress?

A

A: _e() echoes the translated string directly, while __() returns the translated string for further use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Q: What is the load_textdomain() function used for?

A

A: It loads a specific text domain for translations in WordPress.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Q: What is a text domain in WordPress?

A

A: A unique identifier for translation files associated with a theme or plugin.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Q: How do you mark a string for translation in WordPress?

A

A: Use functions like __(), _e(), _x(), or _n().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Q: What is the purpose of the _n() function in WordPress?

A

A: It handles plural forms in translations, allowing proper localization of singular and plural strings.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Q: What tools can you use to create .po and .mo files?

A

A: Tools like Poedit, Loco Translate, or the WordPress CLI.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Q: How do you generate a .pot file for a theme or plugin?

A

A: Use xgettext or plugins like Loco Translate to extract translatable strings into a .pot file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Q: Where should translation files for themes be stored?

A

A: In the /languages/ folder of the theme or in /wp-content/languages/themes/.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Q: Where should translation files for plugins be stored?

A

A: In the /languages/ folder of the plugin or /wp-content/languages/plugins/.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Q: Name three popular WordPress plugins for multilingual websites.

A

A: WPML (WordPress Multilingual Plugin), Polylang, and TranslatePress.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Q: What is the difference between WPML and Polylang?

A

A: WPML is a premium plugin offering extensive features, while Polylang is free with a premium option and lighter in functionality.

19
Q

Q: How does TranslatePress work for multilingual sites?

A

A: It provides a visual translation interface directly on the front-end, making it easy to translate content in real-time.

20
Q

Q: What is the purpose of automatic translation plugins like Weglot?

A

A: They use machine translation to automatically translate WordPress content into multiple languages.

21
Q

Q: How do you create separate content for each language in WordPress?

A

A: Use a multilingual plugin to create separate pages, posts, or categories for each language.

22
Q

Q: What is a language switcher in WordPress?

A

A: A navigation element that allows users to switch between different language versions of a website.

23
Q

Q: How does the WordPress Multisite feature help with multilingual sites?

A

A: You can create a separate site for each language in a Multisite network, managing them independently.

24
Q

Q: How do you translate custom post types?

A

A: Use multilingual plugins that support custom post types, like WPML or Polylang, to translate the content.

25
Q

Q: What is the hreflang tag, and why is it important?

A

A: The hreflang tag specifies the language and regional targeting for a page, improving SEO for multilingual sites.

26
Q

Q: How do multilingual plugins handle SEO?

A

A: They generate unique URLs for each language, add hreflang tags, and allow language-specific metadata.

27
Q

Q: What is the best URL structure for multilingual sites?

A

A: Language subdirectories (e.g., example.com/en/) or subdomains (e.g., en.example.com).

28
Q

Q: How do you set language-specific SEO metadata in WordPress?

A

A: Use plugins like Yoast SEO or Rank Math in conjunction with multilingual plugins to define metadata for each language.

29
Q

Q: How do you display dates and times in the correct format for a specific locale?

A

A: Use the date_i18n() function, which formats dates based on the site’s language and timezone settings.

30
Q

Q: How do you set the site language in WordPress?

A

A: Go to Settings > General and select the desired language from the “Site Language” dropdown.

31
Q

Q: What is the difference between timezones and locales in WordPress?

A

A: Timezones determine the time settings, while locales define language, formatting, and cultural preferences.

32
Q

Q: What is the purpose of the __ngettext() function?

A

A: It is an older version of _n() used for handling singular and plural translations, now mostly deprecated.

33
Q

Q: How do you localize JavaScript files in WordPress?

A

A: Use wp_localize_script() to pass translated strings and variables from PHP to JavaScript.

34
Q

Q: What is the role of the gettext filter in WordPress?

A

A: It allows you to override translations dynamically by filtering strings.

35
Q

Q: How can you translate strings that are hardcoded in your theme or plugin?

A

A: Wrap the strings in translation functions like __() and ensure they are included in the .pot file.

36
Q

Q: How do you test if your WordPress translations are working correctly?

A

A: Change the site language in Settings > General, and verify if the strings are displayed in the selected language.

37
Q

Q: What is a common cause of translations not showing up in WordPress?

A

A: Missing or incorrectly named .mo files, or the text domain not being loaded properly.

38
Q

Q: How do you debug translation issues in WordPress?

A

A: Enable WP_DEBUG, use the gettext filter to check loaded strings, and verify the text domain is correctly registered.

39
Q

Q: What tool can you use to scan themes/plugins for translation readiness?

A

A: Use plugins like Theme Check or tools like Poedit.

40
Q

Q: Why should you avoid hardcoding text in WordPress themes/plugins?

A

A: To make the site translation-ready and ensure flexibility for future localization.

41
Q

Q: How do you ensure your theme or plugin is translation-ready?

A

A: Use proper internationalization functions, create a .pot file, and test translations.

42
Q

Q: Why is it important to separate language-specific content?

A

A: To ensure clear organization, SEO optimization, and accurate translations.

43
Q

Q: What is the advantage of using professional translation services for WordPress?

A

A: They provide accurate and culturally appropriate translations, especially for business-critical content.