Skip to content

Commit

Permalink
Merge pull request #6 from iosphere/feature/support-trailing-columns
Browse files Browse the repository at this point in the history
Feature/support trailing columns
  • Loading branch information
klaftertief committed Jul 28, 2017
2 parents 3289fde + 905aa64 commit 9040a86
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/CSV/Import.elm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ allModuleNames lines =
moduleNameForLine : List String -> Maybe String
moduleNameForLine columns =
case columns of
[ modulename, _, _, _, _ ] ->
modulename :: _ :: _ :: _ :: _ :: xs ->
Just modulename

_ ->
Expand All @@ -102,7 +102,7 @@ linesForModule moduleName lines =
fromLine : List String -> Maybe Localized.Element
fromLine columns =
case columns of
[ modulename, key, comment, placeholders, value ] ->
modulename :: key :: comment :: placeholders :: value :: xs ->
Just (code modulename key comment placeholders value)

_ ->
Expand Down
4 changes: 2 additions & 2 deletions tests/Tests/CSV/Import.elm
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ inputCSV : String
inputCSV =
CSV.Template.headers
++ """
"Translation.Test","myString","My comment","","Value"
"Translation.Test","myString","My comment","","Value","IGNORE"
"Translation.Test","myFormat","","label","Prefix: {{label}}"
"Translation.Test","myFormatAtBeginning","","label","{{label}} suffix"
"Translation.Test","myFormatAtBeginning","","label","{{label}} suffix","IGNORE","IGNORE"
"Translation.Test","myFormatQuoted","","label","Prefix '{{label}}' suffix"
"""

Expand Down

0 comments on commit 9040a86

Please sign in to comment.