sonic-pi

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

C++

Code. Music. Live.

GetText#ns_

call-seq:
  nsgettext(msgid, msgid_plural, n, div = "|")
  nsgettext(msgids, n, div = "|")  # msgids = [msgid, msgid_plural]
  ns_(msgid, msgid_plural, n, div = "|")
  ns_(msgids, n, div = "|")  # msgids = [msgid, msgid_plural]

The nsgettext is similar to the ngettext.
But if there are no localized text,
it returns a last part of msgid separeted "div".

* msgid: the singular form with "div". (e.g. "Special|An apple")
* msgid_plural: the plural form. (e.g. "%{num} Apples")
* 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.

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-ns_-for-pr


# Commit to git

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


# 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-ns_-for-pr

hub pull-request


# Celebrate!