Gettext icon indicating copy to clipboard operation
Gettext copied to clipboard

Make use of msgctxt

Open limogin opened this issue 3 years ago • 1 comments

It is possible to make use of msgctxt context into the .po file definition? There is no clear method from native functions to get the translation of a context either. Or I haven't found.

The method Translattion::withContext ($s) { .. } / Translation:getContext ($s) { .. } would meet this?

Thanks,

limogin avatar Feb 10 '22 16:02 limogin

Not sure to understand your question. If you mean PHP native gettext extension, the context is not supported, but you can see here how it's emulated in the translator functions of this library: https://github.com/php-gettext/Translator/blob/master/src/GettextTranslator.php#L80

oscarotero avatar Feb 10 '22 18:02 oscarotero