|
@@ -0,0 +1,20 @@
|
|
|
+#!/usr/bin/env python
|
|
|
+
|
|
|
+from babel.messages.pofile import read_po, write_po
|
|
|
+
|
|
|
+
|
|
|
+with open('src/sentry/locale/en/LC_MESSAGES/django.po') as f:
|
|
|
+ backend = read_po(f)
|
|
|
+with open('javascript.po') as f:
|
|
|
+ frontend = read_po(f)
|
|
|
+
|
|
|
+for message in frontend:
|
|
|
+ if message.id == '':
|
|
|
+ continue
|
|
|
+ old_msg = backend.get(message.id)
|
|
|
+ message.locations = sorted(
|
|
|
+ set(message.locations) | set(old_msg and old_msg.locations or ()))
|
|
|
+ backend[message.id] = message
|
|
|
+
|
|
|
+with open('final.po', 'w') as f:
|
|
|
+ write_po(f, backend)
|