Skip to content

Commit 9040a86

Browse files
authored
Merge pull request #6 from iosphere/feature/support-trailing-columns
Feature/support trailing columns
2 parents 3289fde + 905aa64 commit 9040a86

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/CSV/Import.elm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ allModuleNames lines =
8787
moduleNameForLine : List String -> Maybe String
8888
moduleNameForLine columns =
8989
case columns of
90-
[ modulename, _, _, _, _ ] ->
90+
modulename :: _ :: _ :: _ :: _ :: xs ->
9191
Just modulename
9292

9393
_ ->
@@ -102,7 +102,7 @@ linesForModule moduleName lines =
102102
fromLine : List String -> Maybe Localized.Element
103103
fromLine columns =
104104
case columns of
105-
[ modulename, key, comment, placeholders, value ] ->
105+
modulename :: key :: comment :: placeholders :: value :: xs ->
106106
Just (code modulename key comment placeholders value)
107107

108108
_ ->

tests/Tests/CSV/Import.elm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ inputCSV : String
4242
inputCSV =
4343
CSV.Template.headers
4444
++ """
45-
"Translation.Test","myString","My comment","","Value"
45+
"Translation.Test","myString","My comment","","Value","IGNORE"
4646
"Translation.Test","myFormat","","label","Prefix: {{label}}"
47-
"Translation.Test","myFormatAtBeginning","","label","{{label}} suffix"
47+
"Translation.Test","myFormatAtBeginning","","label","{{label}} suffix","IGNORE","IGNORE"
4848
"Translation.Test","myFormatQuoted","","label","Prefix '{{label}}' suffix"
4949
"""
5050

0 commit comments

Comments
 (0)