Giter VIP home page Giter VIP logo

crowdin-config's Introduction

crowdin-config

Config for Crowdin translation projects on https://translate.freecodecamp.org

Segmentation Rules

The segmentation.srx file contains the default segmentation rules that Crowdin applies, with a modification to prevent breaking strings within inline code tags.

If you see a file on Crowdin which has a string split where it shouldn't be, try applying this rule set first to resolve the issue. If this file does not fix the issue you are seeing, you can modify the first rule (marked with a comment) to account for the edge case you are seeing.

Modifying the Rule

When you want the string to not break, leave rule break="no" set. Idenfity where the string is being broken. Within the beforebreak tags for the rule, add the text for the portion of the string before the break. Within the afterbreak tags for the rule, add the text for the portion of the string after the break.

A couple of notes regarding rule definitions:

  • The rules use standard Regex syntax, so you will need to escape characters such as .
  • The beforebreak Regex should be ended with a whitespace \s character.

Example

If the string I come first. I come second is within code tags but Crowdin is still splitting it, you would modify the first rule to be:

<rule break="no">
    <beforebreak>come\sfirst\.\s</beforebreak>
    <afterbreak>I\scome</afterbreak>
</rule>

QA Checks

Within the qa-checks directory are all of our custom Quality Assurance checks set up in Crowdin. These checks run against contributors' translations to ensure they meet the standards and will not break anything.

Validate Code Blocks Match

This check asserts that a translation has not modified the contents of a string within code blocks, either inline or multi-line.

Validate If Numbered Tags Exist

Crowdin's UI will replace tags such as <code> with a number (which is how they map the tags between the source and translation). This view will break the code blocks validation, so we have a QA that confirms contributors are using the setting that does not mask the tags with numbers.

Validate Inline Code Blocks

This QA confirms that a translation has not added or removed inline code tags, and that the contents of those code tags have not been translated.

Validate Message Boxes

Our contributing documentation uses the flexible-alerts plugin for Docsify. This plugin relies on specific keywords to render a special message box. The QA asserts that those keywords have not been translated.

Adding new QA Checks

If a new QA check is needed, you should construct that QA check within the test project on Crowdin. Once you have the QA check working, you should add it to this repository as a .js file.

Because Crowdin does not accept QA checks as functions, the utils.js file will wrap your new check in a function for the test runner. You should add a matching .test.js file to correspond with your new QA check. Refer to the existing .test.js files for the format this file should take.

Finally, add a corresponding .js file in the __fixtures directory to contain your test cases. Account for as many edge cases as you can.

crowdin-config's People

Contributors

ojeytonwilliams avatar raisedadead avatar randelldawson avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

seanpm2001 mot01

crowdin-config's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/node.js.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • actions/setup-node v4
npm
package.json
  • jest 29.7.0

  • Check this box to trigger a request for Renovate to run again on this repository

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.