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 5282ea43fe
Apply WaboSign rebrand sweep to upstream 3.0.1
4 weeks ago
..
en Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
fr Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
ja Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
zh-CN Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
README.md Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
ar.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
bg.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
ca-CAT.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
ca.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
da-DK.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
de-AT.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
de-CH.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
de.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
ee.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-AU.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-BORK.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-CA.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-GB.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-IND.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-KE.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-MS.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-NEP.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-NG.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-NZ.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-PAK.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-SG.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-TH.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-UG.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-US.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-ZA.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en-au-ocker.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
en.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
es-AR.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
es-MX.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
es.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
fa.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
fi-FI.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
fr-CA.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
fr-CH.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
fr.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
he.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
hy.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
id.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
it.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
ko.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
lt.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
lv.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
mi-NZ.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
nb-NO.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
nl.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
no.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
pl.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
pt-BR.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
pt.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
ru.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
sk.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
sv.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
th.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
tr.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
uk.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
vi.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
zh-CN.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 weeks ago
zh-TW.yml Apply WaboSign rebrand sweep to upstream 3.0.1 4 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