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 all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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.