Skip to content

Commit

Permalink
feature: add romanian (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwittstruck authored Sep 12, 2024
1 parent 5ea887c commit 4f81616
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/qrstorage/qr_codes/qr_code.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Qrstorage.QrCodes.QrCode do

require Logger

@languages ~w[de en fr es tr pl ar ru it pt nl uk cs el fi hu sk]a
@languages ~w[de en fr es tr pl ar ru it pt nl uk cs el fi hu sk ro]a
@block_list ~w[https http www]

@voices ~w[male female]a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ defmodule Qrstorage.Services.Translate.TranslateApiServiceImpl do
:el => :EL,
:fi => :FI,
:hu => :HU,
:sk => :SK
:sk => :SK,
:ro => :RO
}

@impl TranslateApiService
Expand Down
6 changes: 4 additions & 2 deletions lib/qrstorage/services/tts/text_to_speech_mapping.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ defmodule Qrstorage.Services.Tts.TextToSpeechMapping do
:el => %{"female" => "Irini"},
:fi => %{"female" => "Elina-DNN", "male" => "Benoit-premium"},
:hu => %{"female" => "Kinga", "male" => "Attila"},
:sk => %{"female" => "Simona", "male" => "Jakub"}
:sk => %{"female" => "Simona", "male" => "Jakub"},
:ro => %{"female" => "Adina", "male" => "Teodor"}
}

@language_codes %{
Expand All @@ -38,7 +39,8 @@ defmodule Qrstorage.Services.Tts.TextToSpeechMapping do
:el => "el_gr",
:fi => "fi_fi",
:hu => "hu_hu",
:sk => "sk_sk"
:sk => "sk_sk",
:ro => "ro_ro"
}

def voice(language, gender) when is_atom(language) do
Expand Down
3 changes: 3 additions & 0 deletions priv/gettext/de/LC_MESSAGES/languages.po
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ msgstr "Ungarisch"

msgid "sk"
msgstr "Slowakisch"

msgid "ro"
msgstr "Rumänisch"
3 changes: 3 additions & 0 deletions priv/gettext/en/LC_MESSAGES/languages.po
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ msgstr "Hungarian"

msgid "sk"
msgstr "Slovak"

msgid "ro"
msgstr "Romanian"
3 changes: 3 additions & 0 deletions priv/gettext/languages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ msgstr ""

msgid "sk"
msgstr ""

msgid "ro"
msgstr ""
2 changes: 1 addition & 1 deletion test/qrstorage_web/views/helpers/voice_helpers_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule QrstorageWeb.VoiceHelpersTest do

describe "languages_with_male_voice/0" do
test "returns all languages with male voices as json" do
languages = ["es", "nl", "fr", "tr", "de", "en", "ar", "ru", "it", "pt", "fi", "hu", "sk"]
languages = ["es", "nl", "fr", "tr", "de", "en", "ar", "ru", "it", "pt", "fi", "hu", "sk", "ro"]
assert Enum.sort(Jason.decode!(languages_with_male_voice())) == Enum.sort(languages)
end

Expand Down

0 comments on commit 4f81616

Please sign in to comment.