This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
messages.htm | |
messages.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PROJECT_SLUG="myproject" | |
for resource in $(find trunk/tr/messages -name '*.po' -type f); do | |
resource_slug=$(basename "$resource" ".po") | |
resource_identifier="${PROJECT_SLUG}.${resource_slug}" | |
tx set --auto-local \ | |
-r "$resource_identifier" "trunk/<lang>/messages/${resource_slug}.po" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
def humanize_wordcount(value, lower_bound=10**3, upper_bound=10**12): | |
""" | |
Similar to humanize's intword. Converts a large integer to a friendly text | |
representation. For example, 1000 becomes '1K', 1000000 becomes '1M' etc. | |
""" | |
try: | |
value = int(value) | |
except (TypeError, ValueError): |