sonic-pi

https://github.com/sonic-pi-net/sonic-pi

C++

Code. Music. Live.

GetText#np_

call-seq:
  npgettext(msgctxt, msgid, msgid_plural, n)
  npgettext(msgctxt, msgids, n)  # msgids = [msgid, msgid_plural]
  np_(msgctxt, msgid, msgid_plural, n)
  np_(msgctxt, msgids, n)  # msgids = [msgid, msgid_plural]

The npgettext is similar to the nsgettext function.
  e.g.) np_("Special", "An apple", "%{num} Apples", num) == ns_("Special|An apple", "%{num} Apples", num)
* msgctxt: the message context.
* msgid: the singular form.
* msgid_plural: the plural form.
* n: a number used to determine the plural form.
* Returns: the localized text which key is msgid_plural if n is plural(follow plural-rule) or msgid.
  "plural-rule" is defined in po-file.
:nodoc:
:nodoc:

Source | Google | Stack overflow

Edit

git clone [email protected]:sonic-pi-net/sonic-pi.git

cd sonic-pi

open app/server/ruby/vendor/gettext-3.4.3/lib/gettext.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-GetText-np_-for-pr


# Commit to git

git add app/server/ruby/vendor/gettext-3.4.3/lib/gettext.rbgit commit -m "better docs for GetText#np_"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-GetText-np_-for-pr

hub pull-request


# Celebrate!