While we used the most common internationalization functions in this chapter, there are a few more advanced functions that may be useful in your efforts:
- _n( $singular, $plural, $number, $domain ): This function will look up one of the first two strings received, depending on whether the number is one or more.
- _x( $text, $context, $domain ): Adds a parameter to the localization lookup to add a context parameter. This is useful when dealing with words that have the same spelling but different meanings.
- _ex( $text, $context, $domain ): Same as _x but echoes the result of the lookup.
- _nx( $singular, $plural, $number, $context, $domain): Same as _n with the additional context parameter from _x.
There are also a number of functions that will perform a localization lookup immediately, followed by the escape of the resulting string. These functions include esc_attr__(), esc_attr_e(), esc_html__(), esc_html_x(), and many more. For a full list of internationalization functions, visit https://codex.wordpress.org/L10n.