sonic-pi
https://github.com/sonic-pi-net/sonic-pi
C++
Code. Music. Live.
I18n::Backend::Fallbacks#translate
Overwrites the Base backend translate method so that it will try each locale given by I18n.fallbacks for the given locale. E.g. for the locale :"de-DE" it might try the locales :"de-DE", :de and :en (depends on the fallbacks implementation) until it finds a result with the given options. If it does not find any result for any of the locales it will then throw MissingTranslation as usual. The default option takes precedence over fallback locales only when it's a Symbol. When the default contains a String, Proc or Hash it is evaluated last after all the fallback locales have been tried.
Edit
git clone [email protected]:sonic-pi-net/sonic-pi.git
cd sonic-pi
open app/server/ruby/vendor/i18n-1.14.1/lib/i18n/backend/fallbacks.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-I18n--Backend--Fallbacks-translate-for-pr
# Commit to gitgit add app/server/ruby/vendor/i18n-1.14.1/lib/i18n/backend/fallbacks.rbgit commit -m "better docs for I18n::Backend::Fallbacks#translate"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-I18n--Backend--Fallbacks-translate-for-pr
hub pull-request
# Celebrate!