Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

string _p(string $phrase [, array $replacements] )

...

 Wrap your phrases phrase or var_name in the _p() function and it will automatically add it to the clients database in case they wish to translate into other languages.. The phrase/var_name have to define at phrase.json

Info
titleHow to define?

To know how to define a phrase, please check here: Phrase System


Parameters

...

$phrase

English phrase .or Var name

$replacements

Pass an associative array to add dynamic phrases. 

Examples

...

Code Block
languagephp
title_p example
linenumberstrue
/**
 * Prints the phrase "Hello World!" and tries to find
 * a translation in the database if it exists.
 */
echo _p('Hello World!');


/**
 * Pass an associative array to add dynamic phrases.
 */
echo _p('My name is {{ name }}', ['name' => 'Bob']);