Code Monkey home page Code Monkey logo

frc-docs-translations's Introduction

Update Translations

frc-docs-translations

This is the central repository that RTD points toward to view translations.

Interested in Translating?

Please visit the translation guide here

Building Locally

Please note: Python 3.6 or higher is required to build this documentation

First, clone this repo using the follwowing command

  • git clone --recurse-submodules https://github.com/wpilibsuite/frc-docs-translations.git

and ensure that all requirements are up-to-date by running

  • pip install -r frc-docs/source/requirements.txt

Translated documents can be built by running

  • sphinx-build -D language=LANG -b html . _build/html

where LANG is the locale code of your language. You can view a list of supported locales, by checking the locale directory.

Updating Translations

Grabbing your API Key

Updating translations locally requires a Transifex API key. To get started, select your avatar in the top right of the transifex dashboard.

Then select "User settings"

Then select the "API token" option in the lefthand menu.

Now press the "Generate a token" button

This will bring up a screen containing your API key. Write this down and save it.

Pulling from Transifex

The first step is to generate all translatable files from Sphinx. This can be done with the gettext builder. Type the below command to generate translatable POT files.

sphinx-build -T -b gettext frc-docs/source locale/pot

Go ahead and run the below command to save your transifex token to the python transifex client.

tx init --force-save

This will bring up a prompt where you can paste in your API token.

Now we need to grab a list of currently used resources (and their slugs) to grab from transifex. Go ahead and run the command below to do that.

sphinx-intl update-txconfig-resources -p locale/pot -d locale --transifex-project-name frc-docs

In the translation project directory, the below command can be used to grab all reviewed French (Canada) translations.

tx pull -l fr_CA --mode onlyreviewed --use-git-timestamps

You can replace fr_CA with the language code that you want to pull from transifex.

frc-docs-translations's People

Contributors

austinshalit avatar daltz333 avatar github-actions[bot] avatar grahamsh-llk avatar mendax1234 avatar rffontenelle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frc-docs-translations's Issues

Homepage buttons don't work when button text is translated

Description

When adding translations of text for the buttons on the home page, the buttons become inactive and are replaced with simple text of the translation instead of a button containing the translated text. None of the text is clickable.

Screenshot

For reference, these are the "Returning Teams" and "New Teams" sections on the home page. The text in the bottom of each card is supposed to have buttons, e.g. "Changelog" or "Go to Zero-to-Robot".

Screenshot 2023-12-28 at 9 29 25 PM

Note: I am going to revert the changes so that the latest version of the site is functional.

Generate a translation priority list

Suggestion(s)

  1. Use any analytics that might exist for page traffic to figure out which wpilib pages are the most used and create a list ordered from most to least visited and use that as a reference order for translating pages. This would probably need to be regenerated at the beginning/end of each build season.
  2. If that data is difficult to use or non-existent, a fallback might be doing some sort of site-mapping exercise and assigning some heuristic based on depth of resource (e.g. how many links you'd have to click to get there from a top-level link to get to the page) and/or based on prevalence (e.g. how many pages link back to a page).

This would help translation teams make the most impact early on and avoid duplicated effort on new/high-churn pages.


Context

I have been leading the translation for the Japanese frc-docs for the past several months. A common thought I've had is "it's difficult to figure out what to translate next". When there's not a clear answer, I usually ask around until we settle on something, but this isn't a great use of time and doesn't guarantee we are working on a page that is actually that useful.

My manual process has basically boiled down to:

  1. Translate explicit zero-to-robot resources
  2. Translate resources that are referenced in the indices for zero-to-robot
  3. Translate random pages that are referenced in zero-to-robot pages
  4. Translate pages that feel important
  5. ???

Not to say this is a terrible approach, but we are getting to a point where we are spending relatively a bit more time pondering on what to work on vs. actually working on things.

I also think it's helpful for delegating and motivating. I would always have the next item ready to go when I have a translator who has time to help, and translators always know they are working on the most important thing that needs to be worked.

Remove unused assets from Transifex

Currently whenever we move or rename articles, it creates duplicates on Transifex. We should be able to do a pull of the transifex documents and see which ones then get used. We'll then run a script to delete the unused assets from transifex.

Make POT generation a bit smarter

It was nice having clean git diffs previously, but because of Sphinx's incremental builder it wouldn't delete the deleted POTs when a resource was deleted. We should not recreate all the POTS, just delete the deleted ones.

Handle Documentation Resource Move

We need to handle the situation where a resource is relocated.

If we detect a relocated resource using a git diff, we should: push source updates, pull the new translations, upload the old .po translation file to the newly created resource, lock/delete old resources.

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.