Skip to content

Commit

Permalink
Merge pull request raithos#342 from Patschke/master
Browse files Browse the repository at this point in the history
Fix xws import error
  • Loading branch information
raithos authored Mar 26, 2019
2 parents 5e0a8d9 + 286cfe9 commit 8d9588b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 5 additions & 2 deletions coffeescripts/xwing.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2566,8 +2566,11 @@ class exportObj.SquadBuilder
loadFromXWS: (xws, cb) ->
success = null
error = null

version_list = (parseInt x for x in xws.version.split('.'))

if xws.version?
version_list = (parseInt x for x in xws.version.split('.'))
else
version_list = [0,2] # Version tag is optional, so let's just assume it is some 2.0 xws if no version is given

switch
# Not doing backward compatibility pre-1.x
Expand Down
10 changes: 7 additions & 3 deletions translation_helper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ If you don't, all ships in your language will be named "CHANGE ME"...;-)
You also want to translate some common phrases that yasb wants to add to the
cards, found in `phrase_translations.json`.

3. Run the translate script with the following command:
3. Create Translation
3a. Save last Translation

mv ./translation-[LANGUAGE].coffee ./translation-[LANGUAGE].old.coffee

3b. Run the translate script with the following command:

python3 translate.py -l [YOUR LANGUAGE]

Expand All @@ -39,8 +44,7 @@ It also creates a `todo.txt`, telling you on which cards it may need some help.

4. Merge the translation file into the existing translation:

touch empty
git merge-file ../coffescript/cards-[LANGUAGE].coffe ./empty ./translation.coffee
git merge-file ../coffescript/cards-[LANGUAGE].coffe ./translation-[LANGUAGE].old.coffee ./translation-[LANGUAGE].coffee

This will merge the new translation into the existing one for your language (so e.g. new cards will be added). If the merge does not recognice any matches, make sure the line endings match ;-)
Proceed as usual for git merges.
2 changes: 1 addition & 1 deletion translation_helper/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def choose_by_language(input_json, chosen_language):
manual_stuff += ('%s\n' % typo)

# write output
output_file = open("translation.coffee", "w", encoding="utf8")
output_file = open("translation-%s.coffee"%lang, "w", encoding="utf8")
output_file.write(output_text)
output_file.close()

Expand Down

0 comments on commit 8d9588b

Please sign in to comment.