Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spanish translation #1130

Merged
merged 21 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
aa37149
original spanish translation PO file
emlys Dec 5, 2022
36476e6
remove dev mode requirement to show language setting
emlys Dec 6, 2022
aa1a2a4
uncomment internationalizion step of setup.py build process
emlys Dec 6, 2022
045654f
include MO files in build; fix module reload in ui_server
emlys Dec 7, 2022
ccb9371
make sure app rerenders only after localforage settings save
emlys Dec 7, 2022
b00648c
make sure validation messages rerender when language changes
emlys Dec 8, 2022
36387ea
get supported languages and display names through new endpoint
emlys Dec 8, 2022
574a499
remove unused english locale directory
emlys Dec 8, 2022
c1f63f2
refresh app to change language setting
emlys Dec 8, 2022
fb91b11
mock getSupportedLanguages in tests
emlys Dec 8, 2022
7132595
history note
emlys Dec 8, 2022
c8d2f8d
Merge branch 'main' into task/spanish
emlys Dec 8, 2022
3976575
update workbench POT file
emlys Dec 10, 2022
d34e9df
Merge branch 'task/spanish' of https://github.com/emlys/invest into t…
emlys Dec 10, 2022
3d8393c
fix test hanging bug
emlys Dec 15, 2022
4782b74
remove duplicate import
emlys Dec 15, 2022
40d216b
add spanish message catalog for workbench messages and remove zh for now
emlys Dec 15, 2022
a178a34
convert saveSettings function from promise chain to async/await
emlys Jan 5, 2023
16f8201
update emails in PO file headers
emlys Jan 5, 2023
3722b9a
fix language code in spanish PO file
emlys Jan 6, 2023
a28e4d8
mock window.location.reload correctly
emlys Jan 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Unreleased Changes
* Fixed a possible path traversal vulnerability when working with datastack
archives. This patches CVE-2007-4559, reported to us by Trellix.
https://github.com/natcap/invest/issues/1113
* Added a Spanish translation of user-facing text and an interface to switch
languages in the workbench UI.
* Updating descriptions for LULC about text and biophysical table for
clarity in model specs. https://github.com/natcap/invest/issues/1077
* Workbench
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ prune ci
prune exe
prune installer
prune workbench
include src/natcap/invest/internationalization/locales/*/LC_MESSAGES/messages.mo
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know we could include globs here! Very cool.

22 changes: 11 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import os
import platform
import subprocess

import Cython.Build
import numpy
Expand Down Expand Up @@ -30,20 +32,18 @@ class build_py(_build_py):
"""Command to compile translation message catalogs before building."""

def run(self):
# NOTE: un-comment this when we get message catalogs.
#
# internationalization: compile human-readable PO message catalogs
# into machine-readable MO message catalogs used by gettext
# the MO files are included as package data
# locale_dir = os.path.abspath(os.path.join(
# os.path.dirname(__file__),
# 'src/natcap/invest/internationalization/locales'))
# for locale in os.listdir(locale_dir):
# subprocess.run([
# 'pybabel',
# 'compile',
# '--input-file', f'{locale_dir}/{locale}/LC_MESSAGES/messages.po',
# '--output-file', f'{locale_dir}/{locale}/LC_MESSAGES/messages.mo'])
locale_dir = os.path.abspath(os.path.join(
os.path.dirname(__file__),
'src/natcap/invest/internationalization/locales'))
for locale in os.listdir(locale_dir):
subprocess.run([
'pybabel',
'compile',
'--input-file', f'{locale_dir}/{locale}/LC_MESSAGES/messages.po',
'--output-file', f'{locale_dir}/{locale}/LC_MESSAGES/messages.mo'])
# then execute the original run method
_build_py.run(self)

Expand Down
2 changes: 1 addition & 1 deletion src/natcap/invest/annual_water_yield.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from . import utils
from . import validation
from .model_metadata import MODEL_METADATA
from .spec_utils import u
from .unit_registry import u

LOGGER = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion src/natcap/invest/carbon.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from . import validation
from . import utils
from . import spec_utils
from .spec_utils import u
from .unit_registry import u
from .model_metadata import MODEL_METADATA
from . import gettext

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

from .. import utils
from .. import spec_utils
from ..spec_utils import u
from ..unit_registry import u
from .. import validation
from ..model_metadata import MODEL_METADATA
from .. import gettext
Expand Down
2 changes: 1 addition & 1 deletion src/natcap/invest/coastal_blue_carbon/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .. import utils
from .. import validation
from ..model_metadata import MODEL_METADATA
from ..spec_utils import u
from ..unit_registry import u
from . import coastal_blue_carbon

LOGGER = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion src/natcap/invest/coastal_vulnerability.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from . import utils
from . import validation
from .model_metadata import MODEL_METADATA
from .spec_utils import u
from .unit_registry import u

LOGGER = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion src/natcap/invest/crop_production_percentile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from . import utils
from . import spec_utils
from .spec_utils import u
from .unit_registry import u
from . import validation
from .model_metadata import MODEL_METADATA
from . import gettext
Expand Down
2 changes: 1 addition & 1 deletion src/natcap/invest/crop_production_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pygeoprocessing
import taskgraph

from .spec_utils import u
from .unit_registry import u
from . import spec_utils
from . import utils
from . import validation
Expand Down
2 changes: 1 addition & 1 deletion src/natcap/invest/delineateit/delineateit.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .. import utils
from .. import validation
from ..model_metadata import MODEL_METADATA
from ..spec_utils import u
from ..unit_registry import u
from . import delineateit_core

LOGGER = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion src/natcap/invest/forest_carbon_edge_effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from . import utils
from . import validation
from .model_metadata import MODEL_METADATA
from .spec_utils import u
from .unit_registry import u

LOGGER = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion src/natcap/invest/globio.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from . import utils
from . import validation
from .model_metadata import MODEL_METADATA
from .spec_utils import u
from .unit_registry import u

LOGGER = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion src/natcap/invest/habitat_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from . import spec_utils
from . import utils
from . import validation
from .spec_utils import u
from .unit_registry import u
from . import gettext


Expand Down
2 changes: 1 addition & 1 deletion src/natcap/invest/hra.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from . import utils
from . import validation
from .model_metadata import MODEL_METADATA
from .spec_utils import u
from .unit_registry import u

LOGGER = logging.getLogger(__name__)

Expand Down
Empty file.
Loading