Skip to content

Fix hardcoded I18n text in specs, part 1

Adam Hegyi requested to merge fix-hardcoded-i18n-text-in-specs into master

What does this MR do?

Contributes to #214654

The first of many MRs to make an attempt to get a test suite that can run successfully using any locale.

The changes have been made programmatically by parsing the pipeline test results of another MR where pseudo localization was enabled.

6713         Diff:
6714         @@ -1,5 +1,5 @@
6715          [{:class=>"Geo::LfsObjectDeletedEventStore",
6716         -  :error=>"Validation failed: File path can't be blank",
6717         +  :error=>"Validation failed: File path čàʼn'ṱ ƃè ḅłåʼnƙ",
6718            :file_path=>nil,
6719            :lfs_object_id=>356,
6720            :message=>"Lfs object deleted event could not be created"}]
6721       # ./vendor/ruby/2.6.0/gems/rspec-support-3.8.2/lib/rspec/support.rb:97:in `block in <module:Support>'

Example:

  • Hardcoded in test: "can't be blank"
  • Pseudo locale: "čàʼn'ṱ ƃè ḅłåʼnƙ"
  • Original: expect(x).to eq("can't be blank")
  • Fix: expect(x).to eq(_("can't be blank"))

Resources:

Screenshots

Example screenshot with pseudo locale. Notice the amount (text with Latin letters) of untranslated strings.

pseudo

Does this MR meet the acceptance criteria?

Conformity

Edited by Peter Leitzen

Merge request reports