WPML
SignaturePHP
do_action( 'wpml_register_string', string $string_value, string $string_name, array $package, string $string_title, string $string_type )

Description

*Registers a text string for translation. The string being registered is part of a package or a group of strings (as opposed to an individual string**).

*For retrieving a “package” string translation please see: wpml_translate_string

**For registering an individual text string that does not belong to a package please see: wpml_register_single_string

Note: This hook requires the WPML String Translation module

Arguments

  • $string_valuestringRequired

    The string to register for translation
  • $string_namestringRequired

    A unique name for the string
  • $packagearrayRequired

    The package object. Array keys must match the following WPML_Package fields and will be the same for all texts sent to translation for an object:
    • kind

      A free text to identify the package object. Must be the same for all packages of the same type. i.e. ‘Gravity Form’ or ‘Layout’
    • name

      A name to identify the set of strings with. Must be unique for each package of the same type such as an ID.
    • title

      A humanly readable title for the package. Must be different for each package of the same type.
    • edit_link

      Link to edit this set of strings (it can be an empty string)
    • view_link

      Link to view this set of strings (it can be an empty string)
  • $string_titlestringRequired

    The title of the string to be displayed when editing the translation.
  • $string_typestringRequired

    The string kind. Must be one of the following values:
    • AREA

      Anything that must contain multiple rows
    • LINE

      A single line value
    • VISUAL

      This will be shown as a WYSIWYG editor and will be handled as HTML content

Example Usage

A complete and detailed example can be found on the “String Package Translation” documentation page.