Browse Source

macosx: add macro for contextualized translation strings

pull/121/head
Marvin Scholz 5 years ago
committed by Jean-Baptiste Kempf
parent
commit
ae436e9717
  1. 10
      modules/gui/macosx/extensions/NSString+Helpers.h
  2. 2
      po/Makevars

10
modules/gui/macosx/extensions/NSString+Helpers.h

@ -30,6 +30,16 @@
#define _NS(s) ((s) ? toNSStr(vlc_gettext(s)) : @"")
/**
* Get a contextualized translation string
*
* Sometimes a translations needs to be unique to a specific context
* even though it has the same ID (text) as a different translation.
* In this case, this macro should be used with a unique translation
* context as the first argument.
*/
#define _PNS(c, s) (toNSStr(vlc_pgettext(c, s)))
/* Get an alternate version of the string.
* This string is stored as '1:string' but when displayed it only displays
* the translated string. the translation should be '1:translatedstring' though */

2
po/Makevars

@ -10,7 +10,7 @@ subdir = po
top_builddir = ..
# These options get passed to xgettext.
XGETTEXT_OPTIONS = --directory=.. --keyword=_ --keyword=N_ --keyword=_NS --keyword=_ANS --keyword=qtr --keyword=Q_ --language=C++ --keyword=vlc_ngettext:1,2 --keyword=vlc_pgettext:1c,2 --add-comments=xgettext: --from-code=UTF-8
XGETTEXT_OPTIONS = --directory=.. --keyword=_ --keyword=N_ --keyword=_NS --keyword=_ANS --keyword=qtr --keyword=Q_ --language=C++ --keyword=vlc_ngettext:1,2 --keyword=vlc_pgettext:1c,2 --keyword=_PNS:1c,2 --add-comments=xgettext: --from-code=UTF-8
# This is the copyright holder that gets inserted into the header of the
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding

Loading…
Cancel
Save