Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make the --merge functionality of diffstrings actually work

Uncomment the part that actually saves the non-primary locale files.
  • Loading branch information...
commit f6b65cef3e6bad97c045d7391e1ff3a6098a2c70 1 parent d94e648
Owen Yamauchi authored
Showing with 19 additions and 16 deletions.
  1. +19 −16 diffstrings.py
View
35 diffstrings.py
@@ -66,22 +66,25 @@ def mergeProjects(projects, sourceLocaleName, focusedLocaleName=None, verbose=Fa
sourceStrings = project.condenseStringSourceFiles()
sourceStrings.save()
- # for localeName, localizedStrings in project.locales.iteritems():
- # if not focusedLocaleName or focusedLocaleName == localeName:
- # if localizedStrings.name in translations:
- # translation = translations[localizedStrings.name]
- # else:
- # translation = Translation(localizedStrings.name)
- # translation.open(".", "2")
- # translations[localizedStrings.name] = translation
- #
- # if translation.strings:
- # if verbose:
- # localizedStrings.mergeReport(sourceStrings, translation)
- #
- # localizedStrings.mergeTranslation(sourceStrings, translation)
- # if not dryRun:
- # localizedStrings.save()
+ for localeName, localizedStrings in project.locales.iteritems():
+ if not focusedLocaleName or focusedLocaleName == localeName:
+ if localizedStrings.name in translations:
+ translation = translations[localizedStrings.name]
+ else:
+ translation = Translation(localizedStrings.name)
+ translation.open(".")
+ translations[localizedStrings.name] = translation
+
+ if translation.strings:
+ if verbose:
+ localizedStrings.mergeReport(sourceStrings, translation)
+
+ localizedStrings.mergeTranslation(sourceStrings, translation)
+ if not dryRun:
+ localizedStrings.save()
+ else:
+ if verbose:
+ print "no translation.strings for %s, sad" % localeName
###################################################################################################
Please sign in to comment.
Something went wrong with that request. Please try again.