CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Tue, 19 Aug 2025 04:28:23 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20081013145051
location: https://web.archive.org/web/20081013145051/https://github.com/rails/localization/tree
server-timing: captures_list;dur=1.383560, exclusion.robots;dur=0.040591, exclusion.robots.policy;dur=0.017958, esindex;dur=0.021728, cdx.remote;dur=73.256228, LoadShardBlock;dur=150.399366, PetaboxLoader3.datanode;dur=92.823563, PetaboxLoader3.resolve;dur=28.169414
x-app-server: wwwb-app220
x-ts: 302
x-tr: 511
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app220; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Tue, 19 Aug 2025 04:28:24 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.6.31
x-archive-orig-date: Mon, 13 Oct 2008 21:50:51 GMT
x-archive-orig-transfer-encoding: chunked
x-archive-orig-connection: close
x-archive-orig-set-cookie: _github_sess=BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%250ASGFzaHsABjoKQHVzZWR7AA%253D%253D--4d8802a39cf2ae2680fcdf915bd7f8472555cf65; domain=.github.com; path=/; expires=Wed, 01 Jan 2020 08:00:00 GMT
x-archive-orig-status: 200 OK
x-archive-orig-x-runtime: 0.61060
x-archive-orig-etag: "d743602d3f460305cc0ac0608ad02b98"
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-orig-x_commoncrawl_parsesegmentid: 4479
x-archive-orig-x_commoncrawl_originalurl: https://github.com/rails/localization/tree
x-archive-orig-x_commoncrawl_urlfp: 3893242657894840905
x-archive-orig-x_commoncrawl_hostfp: -8801896244620822287
x-archive-orig-x_commoncrawl_signature: d743602d3f460305cc0ac0608ad02b98
x-archive-orig-x_commoncrawl_crawlno: 1
x-archive-orig-x_commoncrawl_fetchtimestamp: 1223934651792
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: ibm852
x-archive-orig-content-encoding: gzip
memento-datetime: Mon, 13 Oct 2008 14:50:51 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Mon, 13 Oct 2008 14:50:51 GMT", ; rel="memento"; datetime="Mon, 13 Oct 2008 14:50:51 GMT", ; rel="next memento"; datetime="Thu, 18 Dec 2008 01:30:52 GMT", ; rel="last memento"; datetime="Fri, 18 Sep 2009 23:00:21 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 1224160489162_54-c/1224160626429_12.arc.gz
server-timing: captures_list;dur=0.504905, exclusion.robots;dur=0.018876, exclusion.robots.policy;dur=0.008617, esindex;dur=0.011245, cdx.remote;dur=23.011029, LoadShardBlock;dur=370.390680, PetaboxLoader3.datanode;dur=283.513023, PetaboxLoader3.resolve;dur=222.947223, load_resource;dur=162.932172
x-app-server: wwwb-app220
x-ts: 200
x-tr: 625
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
rails's localization at master — GitHub
This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (

This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (

Description: | Localization plugin |
Homepage: | https://rubyonrails.org |
Clone URL: |
git://github.com/rails/localization.git
Give this clone URL to anyone.
git clone git://github.com/rails/localization.git
|
name | age | message | |
---|---|---|---|
![]() |
CHANGELOG | Sat Oct 29 07:44:21 -0700 2005 | Localization plugin: Added support for 0, 1, ma... [madrobby] |
![]() |
README | Sat Oct 29 07:28:50 -0700 2005 | Added localization plugin [madrobby] |
![]() |
init.rb | Sat Oct 29 09:04:06 -0700 2005 | Use lib/ style [dhh] |
![]() |
lib/ | Sat Oct 29 09:04:06 -0700 2005 | Use lib/ style [dhh] |
README
= Localization Plugin for Rails This plugin provides a simple, gettext-like method to provide localizations. == Features * Any number of languages or locales * Simple method to defines singluar/plural translations * Can use lambdas to provide Ruby-code based dynamic translations * Customizable for different instances of the application == Usage If the localization plugin is installed, it is used automatically. You need to create a /lang dir in your RAILS_ROOT. The recommended way to use it is to create files that are named like the languages you define in them (but you can put everything in one big file too.) For instance-customizable strings, add overrides in files you put in /lang/custom. === Simple example: Create a file /lang/translations.rb: Localization.define('de') do |l| l.store 'yes', 'Ja' l.store 'no', 'Nein' end Localization.define('fr') do |l| l.store 'yes', 'oui' l.store 'no', 'non' end In your controller or application.rb: Localization.lang = 'de' # or 'fr' In your view: <%=_ 'yes' %> <%=_ 'no' %> Because the _ method is simply an extension to Object, you can use it anywhere (models/controllers/views/libs). === Extended example: Create a file /lang/default.rb with following contents: Localization.define do |l| l.store '(time)', lambda { |t| t.strftime('%I:%M%p') } end Create a file /lang/de_DE.rb with following contents: Localization.define('de_DE') do |l| l.store '%d entries', ['Ein Eintrag', '%d Einträge'] l.store '(time)', lambda { |t| t.strftime('%H:%M') } end In your controller or application.rb: Localization.lang = 'de_DE' In your view: <%=_ '%d entries', 1 %> # singular variant is chosen <%=_ '%d entries', 4 %> # plural variant is chosen <%=_ '(time)', Time.now %> # call the block with a parameter == Translation file guesstimation You can generate a guesstimation of all strings needed to be translated in your views by first adding the _('blah') syntax everywhere and then calling: puts Localization.generate_l10n_file in the Rails console.
This feature is coming soon. Sit tight!