Skip to content

How to get the translation of a picklist value? #53

Closed Answered by rskrzypczak
Enitoxy asked this question in How to
Discussion options

You must be logged in to vote

it's quite simple:
\App\Language::translate($recordModel->get('status_picklist'), $recordModel->getModuleName(), $langFromUser);

	/**
	 * Functions that gets translated string.
	 *
	 * @param string      $key              - string which need to be translated
	 * @param string      $moduleName       - module scope in which the translation need to be check
	 * @param string|null $language         - language of translation
	 * @param bool        $encode           - When no translation was found do encode the output
	 * @param string      $secondModuleName - Additional module name to be translated when not in $moduleName
	 *
	 * @return string - translated string
	 */
	public static function

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Enitoxy
Comment options

Answer selected by Enitoxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
How to
Labels
None yet
2 participants