Skip to content

Commit

Permalink
Merge pull request #1130 from emlys/task/spanish
Browse files Browse the repository at this point in the history
Spanish translation
  • Loading branch information
davemfish authored Jan 20, 2023
2 parents 99dc889 + a28e4d8 commit 2745b5f
Show file tree
Hide file tree
Showing 48 changed files with 5,243 additions and 4,398 deletions.
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
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 @@ -22,7 +22,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

0 comments on commit 2745b5f

Please sign in to comment.