You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docuseal/vendor/bundle/ruby/4.0.0/gems/faker-3.6.1/lib/locales
Wabo d9b86d464c
Restore fork-specific features lost during upstream sync:
3 weeks ago
..
en Restore fork-specific features lost during upstream sync: 3 weeks ago
fr Restore fork-specific features lost during upstream sync: 3 weeks ago
ja Restore fork-specific features lost during upstream sync: 3 weeks ago
zh-CN Restore fork-specific features lost during upstream sync: 3 weeks ago
README.md Restore fork-specific features lost during upstream sync: 3 weeks ago
ar.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
bg.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
ca-CAT.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
ca.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
da-DK.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
de-AT.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
de-CH.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
de.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
ee.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-AU.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-BORK.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-CA.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-GB.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-IND.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-KE.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-MS.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-NEP.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-NG.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-NZ.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-PAK.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-SG.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-TH.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-UG.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-US.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-ZA.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en-au-ocker.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
en.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
es-AR.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
es-MX.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
es.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
fa.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
fi-FI.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
fr-CA.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
fr-CH.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
fr.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
he.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
hy.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
id.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
it.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
ko.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
lt.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
lv.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
mi-NZ.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
nb-NO.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
nl.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
no.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
pl.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
pt-BR.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
pt.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
ru.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
sk.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
sv.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
th.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
tr.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
uk.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
vi.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
zh-CN.yml Restore fork-specific features lost during upstream sync: 3 weeks ago
zh-TW.yml Restore fork-specific features lost during upstream sync: 3 weeks ago

README.md

How Locales Work

The default locale is English. You can see how it is implemented in the "translate" method in Faker.rb.

Here's how to set it:

# Sets the locale to "Simplified Chinese":
Faker::Config.locale = 'zh-CN'

It works so that once the Faker locale is set to a different location, the translate method will check that .yml file for an equivalent and use that data. If it doesn't exist, it defaults back to English. It uses the I18n gem to do this.

Using Chinese as an example, when the locale is set to Chinese and you attempt to call for hipster ipsem (which doesn't exist at the time of this writing), you will get English back. It checks the "zh-CH.yml" file, does not find "hipster" and then checks the "en.yml" file and returns a word from that array.

Faker::Config.locale = 'zh-CN'
Faker::Hipster.word #=> "kogi"

How to update a locale with more translations

To update a locale with more translation features, simply add a new field to the .yml file that corresponds to an existing piece of functionality in the "en.yml" file. In this example, that would mean providing Chinese hipster words.

# /lib/locales/zh-CN.yml
hipster:
    - "屌丝"
# Now this should work:
Faker::Hipster.word #=> "屌丝"

After you've done that, find or create a test file for the locale you've updated and test the functionality for that language.

In our hypothetical example here, one would add something like this to the "test-zh-locale.rb" file in the "test_ch_methods" method:

assert Faker::Hipster.word.is_a? String

How to set the default locale for in threaded server environments

If you want to modify the default locale that will be used in new threads, set it in your configuration:

Faker::Config.default_locale = :pt

In threaded server environments, e.g., Puma, locale per thread can be set as the following:

Faker::Config.locale = :es