Giter VIP home page Giter VIP logo

cc.i18n's Introduction

Creative Commons i18n Tools


🛑 As of 2023-09-27, this project was deprecated by the new CC Legal Tools (cc-legal-tools-app, cc-legal-tools-data).


Author

Nathan R. Yergler <[email protected]>

Organization

Creative Commons

Copyright

2007, Nathan R. Yergler, Creative Commons; licensed to the public under the Expat/MIT license.

ccEngine

This repository is part of the ccEngine: cc-archive/cc.engine.

Package Contents

This package provides the localization dataset for the Creative Commons website, along with a set of tools to manage translations. For historical reasons the CC site templates use abstract string identifiers (ie, "deed.by") instead of the customary English text. Many tools are available for gettext catalogs which assume that the English text is the identifier; the tools included convert between the different formats.

In addition to the tools, the dataset is maintained in two different formats. The po directory contains the gettext .po files in the traditional format, with English text as the string identifiers. The i18n directory contains the gettext .po files in the Creative Commons format, with abstract string identifiers.

Installation

The toolset uses zc.buildout to assemble the software and its dependencies. Buildout will download and install any dependencies needed and install them in the local checkout directory.

To prepare the tools for use:

  1. Clone this repository and change directory into it
  2. Run the boostrap script:

    python bootstrap.py
  3. Run the newly generated buildout script:

    ./bin/buildout
  4. Create a virtual environment within the repository:

    virtualenv .
  5. Activate the virtual environment:

    source bin/activate
  6. Install the transifex client:

    pip install transifex-client

After the buildout process completes the tools will be available in a bin sub-directory. Note that the buildout process "bakes in" explicit paths to any downloaded dependencies; if you move your installation to another location on the filesystem, you must repeat the buildout process.

Managing Translations

Translations are managed through the master .po file and a set of tools.

To add or change translations, edit master/cc_org.po. After editing translations, run the sync script:

./bin/sync

This script will update all files in the po directory with changes to the strings, as well as master/cc_org.po.bak. The .bak file is used to track changes in the English text of strings. For this reason it is important that the master files are committed along with the updated .po files.

Deploying Updated Translations

In order to deploy updated translations, the "normal" .po files need to be converted to CC style files. This is handled by the po2cc script:

./bin/po2cc

Updating Translations

  1. Change directory into the repository
  2. Ensure the repository is up-to-date:

    git pull
  3. Activate the virtual environment:

    source bin/activate
  4. Pull in new translations:

    tx pull -a --mode developer
  5. Commit changes:

    git commit -a -m "Latest i18n updates from Transifex"
  6. Push changes back to origin:

    git push origin master

Deed Translations Displayed

The threshold for whether deed translations are displayed is configured in cc/i18n/util.py Line 15 and 16:

# Percent translated that languages should be at or above
TRANSLATION_THRESHOLD = 80

The threshold is used with the percentages computed by the transstats script.

cc.i18n's People

Contributors

cc-translation-bot avatar cwebber avatar gisleh avatar hamiltonabreu avatar ilabastida avatar kalogatias avatar kgodey avatar mattl avatar musaddar avatar nagyb avatar nyergler avatar polley avatar raselahmed7 avatar satnath avatar sureshiim avatar timidrobot avatar valdisvi avatar veeven avatar vthunder avatar zviangi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cc.i18n's Issues

Remove "da_DK" translation

I suggest removing the empty "da_DK" translation from https://github.com/creativecommons/cc.i18n/tree/master/cc/i18n/po as we use the "da" one for danish.

Useless po Files:

As of 2020-07-16 the following languages are 0% translated:

  1. ach
  2. af_ZA
  3. am
  4. as
  5. be_BY
  6. bs
  7. cs_CZ
  8. cy
  9. da_DK
  10. de_CH
  11. el_GR
  12. en
  13. en_BE
  14. en_US
  15. es_419
  16. es_CO
  17. es_GT
  18. es_MX
  19. es_SV
  20. es_US
  21. eu_ES
  22. fy
  23. id_ID
  24. io
  25. it_IT
  26. ka_GE
  27. ms_MY
  28. or_IN
  29. pa
  30. ro_RO
  31. sah
  32. si
  33. sk_SK
  34. sq_AL
  35. sw
  36. th_TH
  37. tl_PH
  38. tt
  39. tzl
  40. ur
  41. vi_VN
  42. zu_ZA

Generated on production server with:

echo; echo "As of $(date +%Y-%m-%d) the following languages are 0% translated:"; i=1; for lang in $(sed -e's/\r/\n/g' /srv/ccengine/transstats.csv | awk -F, '$5 == 0 {print $1}' | sort -u); do echo "${i}. \`${lang}\`"; (( i++ )); done; echo

Useless Transifex languages

Transifex have 0 translated strings for these:

  • aa_DJ
  • ach
  • af_ZA
  • am
  • as
  • be@tarask
  • be_BY
  • bs
  • cs_CZ
  • cy
  • el_GR
  • en_BE
  • es_419
  • es_CO
  • es_GT
  • es_MX
  • es_SV
  • es_US
  • eu_ES
  • fy
  • id_ID
  • io
  • it_IT
  • ka_GE
  • kn_IN
  • ms_MY
  • or_IN
  • pa
  • ro_RO
  • sah
  • si
  • sk_SK
  • sq_AL
  • sw
  • th_TH
  • tl_PH
  • tt
  • tzl
  • ur
  • vi_VN
  • zu_ZA

About The Licenses page translations are incomplete

Describe the bug

About The Licenses page translations are incomplete.

To Reproduce

The descriptive text underneath the 4.0 licenses do not appear to be translated at all. Examples:

Expected behavior

All of the text should be translated.

Screenshots

Screen Shot 2020-03-25 at 08 45 56

Additional context

I suspect the relevant strings have not been uploaded to Transifex.

Armenia missing from COUNTRY_MAP

Description

Armenia missing from country map even though we have an Armenia 3.0 port.

Expectation

--- cc/i18n/mappers.py
+++ cc/i18n/mappers.py
@@ -2,6 +2,7 @@ from cc.i18n.gettext_i18n import fake_ugettext as _
 
 
 COUNTRY_MAP = {
+    "am": _("Armenia"),
     "ar": _("Argentina"),
     "at": _("Austria"),
     "au": _("Australia"),

(see creativecommons/cc.i18n:cc/i18n/mappers.py: Line 4)

Spelling mistake in Romanian version

Description

the Romanian version of the license page here https://creativecommons.org/licenses/by-nc-nd/4.0/deed.ro says:
"Ajută-ne să construim o colecție comună vribrantă, colaborativă și globală.". In Romanian, it should be "vibrantă" (which vibrates) and not "vribrantă".

This was brought to our attention by Dan Andresan.

Reproduction

  1. Go to https://creativecommons.org/licenses/by-nc-nd/4.0/deed.ro
  2. See error.

Expectation

Spelling error corrected (the deeds are version agnostic--the CC BY-NC-ND deed is used by all versions of the CC BY-NC-ND license)

Resolution

  • I would be interested in resolving this bug.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.