Skip to content

Commit

Permalink
Add script to extract strings for translation
Browse files Browse the repository at this point in the history
  • Loading branch information
pantierra committed Jul 8, 2019
1 parent 8220634 commit 90e14ee
Show file tree
Hide file tree
Showing 14 changed files with 376 additions and 156 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ server/web/static/dist/
logs/
*.log

# Ignore some translation stuff
.tx/tasking-manager.master/

#python
venv/
*pyc
Expand Down
7 changes: 4 additions & 3 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[main]
host = https://www.transifex.com

[tasking-manager-3.master]
[tasking-manager.master]
source_file = client/locale/en.json
source_lang = en
trans.ar = client/locale/ar.json
Expand All @@ -10,11 +10,11 @@ trans.cs = client/locale/cs.json
trans.da = client/locale/da.json
trans.de = client/locale/de.json
trans.es = client/locale/es.json
trans.fi = client/locale/fi.json
trans.fa_IR = client/locale/fa_IR.json
trans.fi = client/locale/fi.json
trans.fr = client/locale/fr.json
trans.hu = client/locale/hu.json
trans.gl = client/locale/gl.json
trans.hu = client/locale/hu.json
trans.id = client/locale/id.json
trans.it = client/locale/it.json
trans.ja = client/locale/ja.json
Expand All @@ -34,3 +34,4 @@ trans.uk = client/locale/uk.json
trans.vi = client/locale/vi.json
trans.zh_TW = client/locale/zh_TW.json
type = KEYVALUEJSON

8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ifndef DOCKER_COMPOSE_VERSION
endif

build:
docker-compose build app
docker-compose build --no-cache app

up:
docker-compose up -d
Expand All @@ -21,6 +21,12 @@ down:
list:
docker-compose ps

refresh-translatables:
docker-compose exec app sh -c "python manage.py refresh_translatables"

refresh-translations:
docker-compose exec app sh -c "tx pull -af"

tests:test-client test-server

test-client:
Expand Down
2 changes: 1 addition & 1 deletion client/app/admin/edit-project/edit-project.html
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ <h1 class="section__aside-title">{{ 'In this area' | translate }}</h1>
{x}, {y} and {z} parameters can only be be used on tasks generated in the Tasking Manager and not on imported tasks.
For example: « This task involves loading extra data. Click [here](http://localhost:8111/import?new_layer=true&url=http://www.domain.com/data/{x}/{y}/{z}/routes_2009.osm) to load the data into JOSM ».' | translate }}</p>
<p ng-if="editProjectCtrl.project.taskCreationMode == 'ARBITRARY'">
{{ 'Put here anything that can be useful to users while taking a task. If you have added extra properties within the GeoJSON of the task, they can be referenced by surrounding them in curly braces. For eg. if you have a property called "import_url" in your GeoJSON, you can reference it like:' | translate }}
{{ 'Put here anything that can be useful to users while taking a task. If you have added extra properties within the GeoJSON of the task, they can be referenced by surrounding them in curly braces. For eg. if you have a property called `import_url` in your GeoJSON, you can reference it like:' | translate }}
<code>This task involves loading extra data. Click [here](http://localhost:8111/import?new_layer=true&url={import_url}) to load the data into JOSM</code>
</p>
<button class="button button--secondary button--small"
Expand Down
6 changes: 3 additions & 3 deletions client/app/home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h2>{{ 'Causes You Can Help' | translate }}</h2>
<li id="story-1" class="field-stories__card">
<h5>{{ 'Red Cross - Ayeyarwady Delta' | translate }}</h5>
<blockquote>
<p>{{ '"The Red Cross is mapping the Ayeyarwady Delta area in Myanmar as part of a multi-year mapping and data readiness activity to better understand where critical infrastructure and roads are to inform decision making during potential disasters. As recently as 2008 a cyclone killed at least 77,000 people with over 55,900 missing, and left about 2.5 million homeless."' | translate }}
<p>"{{ 'The Red Cross is mapping the Ayeyarwady Delta area in Myanmar as part of a multi-year mapping and data readiness activity to better understand where critical infrastructure and roads are to inform decision making during potential disasters. As recently as 2008 a cyclone killed at least 77,000 people with over 55,900 missing, and left about 2.5 million homeless.' | translate }}"
</p>
<footer>
<cite>{{ 'Matt Gibb, Red Cross' | translate }}</cite>
Expand All @@ -62,7 +62,7 @@ <h5>{{ 'Red Cross - Ayeyarwady Delta' | translate }}</h5>
<li id="story-2" class="field-stories__card">
<h5>{{ 'Tanzania Development Trust' | translate }}</h5>
<blockquote>
<p>{{ '"Tanzania has a high incidence of extreme poverty, early marriage and Gender Based Violence. NGOs on the ground need better road and residential area data to facilitate their outreach work. Community mappers from a HOT microgrant, together with YouthMappers from the Institute of Rural Development Planning will map employment opportunities as part of a project to reduce youth vulnerability starting on 26th August. This base map will assist with this field mapping."' | translate }}
<p>"{{ 'Tanzania has a high incidence of extreme poverty, early marriage and Gender Based Violence. NGOs on the ground need better road and residential area data to facilitate their outreach work. Community mappers from a HOT microgrant, together with YouthMappers from the Institute of Rural Development Planning will map employment opportunities as part of a project to reduce youth vulnerability starting on 26th August. This base map will assist with this field mapping.' | translate }}"
</p>
<footer>
<cite>{{ 'Janet Chapman, Tanzania Development Trust' | translate }}</cite>
Expand All @@ -73,7 +73,7 @@ <h5>{{ 'Tanzania Development Trust' | translate }}</h5>
<li id="story-3" class="field-stories__card">
<h5>{{ 'Ongoing Disaster Mapping' | translate }}</h5>
<blockquote>
<p>{{ '"With our disaster mapping program, what we are trying to provide is a common operating picture for the first responders, aid organizations, governments and the affected people to make informed decisions. When all parties are working with the same information, the better situated the community is for quick and effective recovery."' | translate }}
<p>"{{ 'With our disaster mapping program, what we are trying to provide is a common operating picture for the first responders, aid organizations, governments and the affected people to make informed decisions. When all parties are working with the same information, the better situated the community is for quick and effective recovery.' | translate }}"
</p>
<footer>
<cite>{{ 'Russell Deffner, Humanitarian OpenStreetMap Team' | translate }}</cite>
Expand Down
Loading

0 comments on commit 90e14ee

Please sign in to comment.