Internationalizing a ClassicPress plugin: Localization functions

ClassicPress PluginsThis post is part of the sub-series on Internationalizing a ClassicPress plugin which is part of the Internationalizing a ClassicPress plugin series.

There is a number of functions available in ClassicPress which can be used in localising code:

  • __() – this function takes a string and returns the translation if it exists.
  • _e() – this function takes a string and echos the translation if it exists.
  • _n() – this function allows plurals to be handled. It takes 4 parameters: the single form, the plural form, the number based on which one or the other will be displayed and the text domain.
  • _x() – this function is to prevent collisions of similar words. If you plugin uses pair in the sense of a couple of people and pair in the sense of pairing a device via bluetooth as well, collisions could arise. A foreign language might well use very different words for the two.
  • _ex() – this function is the same as the above, but echos the result rather than returning it.
  • _nx() – this function is a combination of pairs and plurals.

There are also six functions which allow us to escape the value for safe usage in attributes and HTML. Considering the above functions, the names are very descriptive:

  • esc_attr__()
  • esc_attr_e()
  • esc_attr_x()
  • esc_html__()
  • esc_html_e()
  • esc_html_x()

Translating a ClassicPress plugin

Translating a ClassicPress plugin
What is Internationalization and Localization?
Why is Internationalization and Localization important?
When should a plugin be internationalized?
Internationalizing a ClassicPress plugin: How does internationalization work?
Internationalizing a ClassicPress plugin: What is a Text Domain and how is it specified?
Internationalizing a ClassicPress plugin: Localization functions
Internationalizing a ClassicPress plugin: Which localization functions to use?
Internationalizing a ClassicPress plugin: Localizing a string
Internationalizing a ClassicPress plugin: Don't paramaterize your text domain
Internationalizing a ClassicPress plugin: Localizing a string containing a parameter
Internationalizing a ClassicPress plugin: Localizing a string including plurals
Internationalizing a ClassicPress plugin: Localizing a string including notes for the translator
Internationalizing a ClassicPress plugin: Don't include HTML markup in localization
Internationalizing a ClassicPress plugin: Don't localize URLs
Internationalizing a ClassicPress plugin: Localizing a string including line breaks
Internationalizing a ClassicPress plugin: Load plugin translations
Translating a ClassicPress plugin with Poedit: What is Poedit?
Translating a ClassicPress plugin with Poedit: Download Poedit
Translating a ClassicPress plugin with Poedit: Install Poedit
Translating a ClassicPress plugin with Poedit: Create New Translation Template
Translating a ClassicPress plugin with Poedit: Create Translations
Translating a ClassicPress plugin with GlotPress: What is GlotPress?
Translating a ClassicPress plugin with GlotPress: Download and install GlotPress
Translating a ClassicPress plugin with GlotPress: Creating administrators
Translating a ClassicPress plugin with GlotPress: Create a project
Translating a ClassicPress plugin with GlotPress: Import translation template
Translating a ClassicPress plugin with GlotPress: Import translations
Translating a ClassicPress plugin with GlotPress: Create new translation set
Translating a ClassicPress plugin with GlotPress: Export translations
Internationalizing a ClassicPress plugin
How does internationalization work?
What is a Text Domain and how is it specified?
Localization functions
Which localization functions to use?
Localizing a string
Don't paramaterize your text domain
Localizing a string containing a parameter
Localizing a string including plurals
Localizing a string including notes for the translator
Don't include HTML markup in localization
Don't localize URLs
Localizing a string including line breaks
Load plugin translations

MDGP October 2019 Release Feature of the Day: Series Index

Microsoft Dynamics GPThe Inside Microsoft Dynamics GP blog has started a series Feature of the Day posts for Microsoft Dynamics GP “October 2019” Release on which I am following and adding commentary. This post is the series index which will automatically update as each post goes live (if you are reading the original MDGP October 2019 Release Feature of the Day post).

There are four key areas in which ehancements can be grouped:

  1. Top Feature Requests by our customers
  2. Financial Enhancements
  3. System Enhancements
  4. Workflow Functionality

Continue reading “MDGP October 2019 Release Feature of the Day: Series Index”