Fix hardcoded I18n text in specs
This issue tracks the effort we are putting into using translated strings in specs.
The following description is taken from !18275 (merged) (thanks @ahegyi
The changes have been made programmatically by parsing the pipeline test results of another MR where pseudo localization was enabled.
- Original MR with pseudo translation: !17757 (closed)
- Translation file: https://gitlab.com/gitlab-org/gitlab/blob/e9378060f3dff0329e6d707a8da40a23e9d9c12f/locale/zz/gitlab.po
- Example pipeline failures: https://gitlab.com/gitlab-org/gitlab/-/jobs/307439937, for example:
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:
- https://en.wikipedia.org/wiki/Pseudolocalization
- https://www.globalizationpartners.com/2015/04/17/what-is-pseudo-localization/
Screenshots
Example screenshot with pseudo locale. Notice the amount (text with Latin letters) of untranslated strings.