-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Closed
Labels
Description
Describe the bug
Calling Faker::Music::Opera.saint_saens will fail with:
...rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/i18n-1.14.1/lib/i18n.rb:394:in `handle_exception': Translation missing: en.faker.opera.french.by_camille_saint_saens (I18n::MissingTranslationData)
To Reproduce
Call 'Faker::Music::Opera.saint_saens` in Faker 3.2.0
Use the reproduction script below to reproduce the issue:
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'faker', :git => 'https://github.com/faker-ruby/faker.git', :branch => 'main'
gem "minitest"
end
require "minitest/autorun"
class BugTest < Minitest::Test
def test_faker
@french_words_are_not_real = Faker::Music::Opera.saint_saens # No need to go further.
end
end
Expected behavior
Return one of:
- L'ancêtre
- Ascanio
- Les barbares
- Déjanire
- Étienne Marcel
- Frédégonde
- Hélène
- Henry VIII
- Phryné
- La princesse jaune
- Proserpine
- Samson and Delilah
- Le timbre d'argent
Additional context
I think it fails because the spelling in the locale is "by_camille_saint_saëns"
While the spelling in the method is: 'opera.french.by_camille_saint_saens'
According to docs I18n should transliterate ëË to eE by default, but I haven't inspected their code or the call stack and another obvious reason for the failure isn't apparent to me.