Skip to content

Commit b423336

Browse files
committed
- Translations now turns nl-NL to nl_NL for Flutter
1 parent 0a154e7 commit b423336

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
4+
## v1.10.6
5+
- Translations now turns nl-NL to nl_NL for Flutter
6+
37
## v1.10.5
48
- Removed web-renderer from web build and run
59

lib/commands/import/translations_import.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ def parse(translations)
109109

110110
text = languageTranslation["value"] || ""
111111
line = {'key' => key, 'translation' => text}
112-
filenameSuffix = locale
112+
# filenameSuffix = locale //TODO: test
113+
filenameSuffix = normalize_flutter_locale(locale)
113114

114115
case type
115116
when "store"
@@ -196,7 +197,17 @@ def parse(translations)
196197

197198
return filesToWrite
198199
end
200+
def normalize_flutter_locale(locale)
201+
return locale if locale.nil?
199202

203+
parts = locale.split(/[-_]/)
204+
205+
if parts.length == 1
206+
parts[0].downcase
207+
else
208+
"#{parts[0].downcase}_#{parts[1].upcase}"
209+
end
210+
end
200211
def write(files)
201212
puts colored :blue, "\n#{CHAR_FLAG} Writing files"
202213

lib/flttr/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Flttr
2-
VERSION = '1.10.5'
2+
VERSION = '1.10.6'
33
end

0 commit comments

Comments
 (0)