Skip to content

Localize Faker::Job for de, de-CH, fr, fr-CH and it#3272

Open
huerlisi wants to merge 1 commit into
faker-ruby:mainfrom
huerlisi:locale-job-de-fr-it
Open

Localize Faker::Job for de, de-CH, fr, fr-CH and it#3272
huerlisi wants to merge 1 commit into
faker-ruby:mainfrom
huerlisi:locale-job-de-fr-it

Conversation

@huerlisi

@huerlisi huerlisi commented Jun 8, 2026

Copy link
Copy Markdown

Motivation / Background

Faker::Job only had data for en (and hy, pt-BR), so every other
locale silently returned English job titles:

Faker::Config.locale = 'it'
Faker::Job.title  #=> "Lead Banking Developer"

Faker::Config.locale = 'de'
Faker::Job.title  #=> "Design Administrator"

This Pull Request adds localized job data for the German, French and
Italian locales. Each provides the keys Faker::Job consumes — field,
seniority, position, key_skills — plus a title template reordered
to fit the language (adjective-after-noun for fr/it). As with the English
generator, titles are synthetic combinations.

Additional information

Output after the change:

Faker::Config.locale = 'de'
Faker::Job.title  #=> "Senior Produktion Planer"

Faker::Config.locale = 'fr'
Faker::Job.title  #=> "Directeur Régional"

Faker::Config.locale = 'fr-CH'
Faker::Job.title  #=> "Responsable Technologie"

Faker::Config.locale = 'it'
Faker::Job.title  #=> "Dirigente Contabilità"

Notes:

  • fr follows the lib/locales/fr/ subfolder convention (new
    fr/job.yml); the other locales get a top-level job: block.
  • de-CH / fr-CH carry their own copies because they do not fall back to
    de / fr.
  • Only the keys consumed by Faker::Job are included (employment_type /
    education_level are not read by any Faker::Job method).

Tests assert Faker::Job.field is a member of the locale's own field list,
guarding against a regression back to the English fallback.

Checklist

  • This Pull Request is related to one change.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • Tests and Rubocop are passing before submitting your proposed changes.

`Faker::Job` only had data for en (and hy, pt-BR), so every other locale
silently returned English titles, e.g. `it` produced "Lead Banking
Developer" and `de` produced "Design Administrator".

Add localized `job` data for the German, French and Italian locales. Each
provides the keys `Faker::Job` consumes — `field`, `seniority`,
`position`, `key_skills` — plus a `title` template reordered to fit the
language (adjective-after-noun for fr/it, e.g. "Directeur Régional",
"Dirigente Contabilità"). As with the English generator, titles are
synthetic combinations.

`fr` follows the lib/locales/fr/ subfolder convention (new fr/job.yml);
the other locales get a top-level `job:` block. `de-CH`/`fr-CH` carry
their own copies since they do not fall back to `de`/`fr`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@huerlisi

huerlisi commented Jun 8, 2026

Copy link
Copy Markdown
Author

In the fr locale job.yml is it's own file. The other touched locales don't follow this pattern, but the docs mention this as preferable.

Should I keep as is, or is this the right moment to introduce a directory for the locales I touched?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant