Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translations/ tweak conversion script and fix locale #12634

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion services/QuillLMS/app/models/translation_prompts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class TranslationPrompts
'ur' => 'Urdu (Nastaliq script)',
'ko' => 'Korean (Hangul script)',
'uk' => 'Ukrainian (Cyrillic script)',
'ts' => 'Tagalog (Latin script)',
'tl' => 'Tagalog (Latin script)',
'prs' => 'Dari (Perso-Arabic script)'
}.freeze

Expand Down
10 changes: 2 additions & 8 deletions services/QuillLMS/lib/tasks/convert_translation_data_to_csv.rake
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,14 @@ namespace :export do
exit
end

def wrap_text(text, max_length = 80)
return text if text.nil?

text.scan(/.{1,#{max_length}}/).join("\n")
end

csv_data = CSV.generate(headers: true) do |csv|
csv << ['ID', 'English Text', 'Translation', 'Suggested Edit']

scope.find_each(batch_size: 1000) do |translated_text|
csv << [
translated_text.id,
wrap_text(translated_text.english_text.text),
wrap_text(translated_text.translation),
translated_text.english_text.text,
translated_text.translation,
''
]
end
Expand Down
6 changes: 6 additions & 0 deletions services/QuillLMS/spec/models/translation_prompts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
it { is_expected.to include('You are going to do a translation from english to Korean (Hangul script)') }
end

context 'tagalog' do
let(:locale) { 'tl' }

it { is_expected.to include('You are going to do a translation from english to Tagalog (Latin script)') }
end

context 'not in the predefined list' do
let(:locale) { 'fr' }

Expand Down
Loading