sonic-pi

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

C++

Code. Music. Live.

GetText#n_

call-seq:
  ngettext(msgid, msgid_plural, n)
  ngettext(msgids, n)  # msgids = [msgid, msgid_plural]
  n_(msgid, msgid_plural, n)
  n_(msgids, n)  # msgids = [msgid, msgid_plural]

The ngettext is similar to the gettext function as it finds the message catalogs in the same way.
But it takes two extra arguments for plural form.

* 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.

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


# Commit to git

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


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

hub pull-request


# Celebrate!