Git Product home page Git Product logo

typescript-website-localizations's Introduction

TypeScript Website Localizations

A repo for handling localized versions of the TypeScript website content

Setting up

git clone https://github.com/microsoft/TypeScript-Website-Localizations
cd TypeScript-Website-Localizations

# Setup
yarn

# Optional: Grab the English files to make translation easier
yarn pull-en

# Optional: Verify your changes will correctly replace the english files
yarn lint
# Alternative: Run the lint watcher
yarn lint --watch

That's it, you've got a copy of all the documentation and now can write documentation which follows the existing patterns. There's a longer intro in welcome.md.

How translations work

The TypeScript website handles translations by having language specific files with matching filepaths:

E.g: /packages/documentation/copy/en/reference/JSX.md

Has existing translations in different languages:

/packages/documentation/copy/id/reference/JSX.md
/packages/documentation/copy/ja/reference/JSX.md
/packages/documentation/copy/pt/reference/JSX.md

Same path, just switched en for id, ja & pt.

This repo

This repo contains all of the non-English locale files. It means you can clone and translate without all the infrastructure overhead of the pretty complex TypeScript-Website.

For example if you wanted to translate a new handbook page you would:

  • Clone this repo (see above)
  • Pull in the English files yarn pull-en (these will be gitignored)
  • Find your english file: docs/documentation/en/handbook-v2/Basics.md
  • Recreate the same folder path in your language: docs/documentation/it/handbook-v2/Basics.md
  • Translate the file!
  • Validate your changes: yarn lint (or yarn lint docs/documentation/it/handbook-v2/Basics.md)
  • Create a pull request to this repo
  • Once merged, the translation will appear on the next website deploy

Language owners

When a new language is created, we ask for a few people to become language owners. These owners are able to merge pull requests to files in their language via code-owner-self-merge in a pull request. They will be pinged on PRs which affect them, you can see the flow in PRs like this or this.

The TypeScript team generally only know English, and can answer clarifying questions if needed! For quick questions, you can use the ts-website-translation channel in the TypeScript Discord.

Secure

This repo has extensive CI to ensure that you can't accidentally break the TypeScript website.

There are local, fast checks that it won't break via yarn test and then the full TypeScript website test suite runs with the changes, and a website build is generated to ensure that nothing breaks.

The checks may not seem obvious to an outsider, because the website is complex, so there is a watch mode which you can run via yarn link --watch to get instant feedback.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Legal Notices

Microsoft and any contributors grant you a license to the Microsoft documentation and other content in this repository under the Creative Commons Attribution 4.0 International Public License, see the LICENSE file, and grant you a license to any code in the repository under the MIT License, see the LICENSE-CODE file.

Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.

Privacy information can be found at https://privacy.microsoft.com/en-us/

Microsoft and any contributors reserve all other rights, whether under their respective copyrights, patents, or trademarks, whether by implication, estoppel or otherwise.

typescript-website-localizations's People

Contributors

bumkeyy avatar cadenzah avatar cockyb avatar danielsychoo avatar deltapy avatar github-actions[bot] avatar gustavofabro avatar htmlin avatar hyunjinee avatar igieri avatar jaryapp avatar jegwan avatar jihoon-seo avatar jvitormf avatar kasterra avatar leandrols avatar luk3skyw4lker avatar manusquall avatar microsoftopensource avatar nabster101 avatar nfabredev avatar ning1315 avatar originalix avatar orta avatar paigekim29 avatar sanghyuk-ch avatar sylviaz89 avatar uraway avatar yahma25 avatar zhongsp avatar

Stargazers

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

Watchers

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

typescript-website-localizations's Issues

[ko] Need to update ko/docs/handbook/utility-types.html

Uppercase<StringType>
Lowercase<StringType>
Capitalize<StringType>
Uncapitalize<StringType>

[English version]

Partial<Type>
Required<Type>
Readonly<Type>
Record<Keys,Type>
Pick<Type, Keys>
Omit<Type, Keys>
Exclude<Type, ExcludedUnion>
Extract<Type, Union>
NonNullable<Type>
Parameters<Type>
ConstructorParameters<Type>
ReturnType<Type>
InstanceType<Type>
ThisParameterType<Type>
OmitThisParameter<Type>
ThisType<Type>
Intrinsic String Manipulation Types
Uppercase<StringType>
Lowercase<StringType>
Capitalize<StringType>
Uncapitalize<StringType>

[Korean version]

Partial<Type>
Readonly<Type>
Record<Keys,Type>
Pick<Type, Keys>
Omit<Type, Keys>
Exclude<Type, ExcludedUnion>
Extract<Type, Union>
NonNullable<Type>
Parameters<Type>
ConstructorParameters<Type>
ReturnType<Type>
InstanceType<Type>
Required<Type>
ThisParameterType<Type>
OmitThisParameter<Type>
ThisType<Type>
내장 문자열 조작 타입

Polish Localization Coordination

For this language there are 870 translated files, with 2274 TODO.

Playground

Done: 0, TODO: 89.

TSConfig Reference

Done: 0, TODO: 157.

Website copy

Done: 8, TODO: 5.

Documentation

Done: 2, TODO: 132.

Issue on weekly-executed GitHub workflow

Problem:

  • weekly-contributions.yml, whose name is Update Attributions Weekly, does
    1. actions/checkout@v2
    2. actions/setup-node@v1
      but nothing else after.
  • weekly.yml, whose name is Weekly issue updates, does
    not only Update all the translation issues on a nightly basis,
    but also Updates the attribution.json file in git.

Proposed Solution:

To make things clear,

  • Separate two jobs into two yml files, or
  • Change the name of weekly.yml to represent two jobs.

Files to Update:

Ukrainian Localization Coordination

For this language there are 860 translated files, with 1891 TODO.

Playground

Done: 0, TODO: 89.

TSConfig Reference

Done: 0, TODO: 157.

Website copy

Done: 0, TODO: 13.

Documentation

Done: 0, TODO: 134.

Indonesian Localization Coordination Issue

For this language there are 860 translated files, with 1498 TODO.

Playground

Done: 40, TODO: 49.

TSConfig Reference

Done: 74, TODO: 83.

Website copy

Done: 9, TODO: 4.

Documentation

Done: 14, TODO: 120.

Portuguese Localization Coordination

For this language there are 236 translated files, with 157 TODO.

Playground

Done: 74, TODO: 15.

TSConfig Reference

Done: 119, TODO: 38.

Website copy

Done: 8, TODO: 5.

Documentation

Done: 35, TODO: 99.

Italian Localization Coordination

For this language there are 907 translated files, with 2630 TODO.

Playground

Done: 0, TODO: 89.

TSConfig Reference

Done: 37, TODO: 120.

Website copy

Done: 0, TODO: 13.

Documentation

Done: 0, TODO: 134.

[Korean] Korean document have weird expressions like '_제네릭_'

It looks like that intended expression as Italic, 제네릭.

In Korean, most of words are composited with postposition(e.g. ~는, ~을). I think it is not correct translation.

In Markdown, in order to express words with italic, we can choose one between *Italic* and _italic_.

What do you think about using *itailc* instead of _italic_. Or we can give some whitespace between word and postposition

Please give any feedback to me. 🙏


한글 문서를 보다보면 _제네릭_과 같이 적혀있는 문서가 좀 있는 것 같은데, 이게 우리나라 조사(예> ~는, ~을)와 붙으면 마크다운에서 이탤릭 표현으로 인식을 못하고 그냥 하나의 단어로 취급해서 이탤릭체가 적용이 안되는 것 같아보이는데요.

마크다운에서 이탤릭체를 쓸 때, *이탤릭*, _이탤릭_, 이 2가지를 모두 허용하고 있는데, 이탤릭체 표현하는 곳을 *이탤릭*으로 바꾸는 것은 어떨까요? 아니면 단어와 조사 사이에 빈공백 하나 주는 방향도 괜찮을 것 같습니다.

피드백 부탁드립니다! 🙏

From clean state, 'yarn lint' gives error

How to reproduce:

git clone https://github.com/microsoft/TypeScript-Website-Localizations
cd TypeScript-Website-Localizations

# Setup
yarn

# Optional: Grab the English files to make translation easier
yarn pull-en

# Optional: Verify your changes will correctly replace the english files
yarn lint
  • 'yarn lint' gives error
..., noLib.md ✓, noPropertyAccessFromIndexSignature.md ⤫, noResolve.md ✓, ...

> /home/jhseo/TypeScript-Website-Localizations/docs/tsconfig/pt/options/noPropertyAccessFromIndexSignature.md

No compiler setting named 'noPropertyAccessFromIndexSignature' exists!


Note: you can add an extra argument to the lint script ( yarn workspace glossary lint [opt] ) to just run one lint.
error Command failed with exit code 1.
  • The error message says that it is related to docs/tsconfig/pt/options/noPropertyAccessFromIndexSignature.md.

A file causes 'local-validate' CI to fail

yarn docs-sync validate-against-en
  shell: /bin/bash -e {0}
yarn run v1.22.5
$ /home/runner/work/TypeScript-Website-Localizations/TypeScript-Website-Localizations/node_modules/.bin/docs-sync validate-against-en
Comparing that all locale files match the en version:

  docs/playground: es✓ fa✓ id✓ ja✓ ko✓ pt✓ vo✓ zh✓
  docs/tsconfig: es✓ id✓ it✓ ja✓ ko✓ pt✓ vo✓ zh✓
  docs/typescriptlang: es✓ id✓ ja✓ pl✓ pt✓ vo✓ zh✓
  docs/documentation: id✓ ja✓ ko✓ pl⤫ pt✓ vo✓ zh✓

Files with paths that aren't the same as English files:

  docs/documentation/pl/handbook-v1/The Handbook.md


error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.
  • Related file: docs/documentation/pl/handbook-v1/The Handbook.md

  • Corresponding English file: docs/documentation/en/handbook-v2/The Handbook.md

  • Suggested solution:

mkdir -p docs/documentation/pl/handbook-v2/
git mv docs/documentation/pl/handbook-v1/The Handbook.md docs/documentation/pl/handbook-v2/The Handbook.md

Japanese Translation Coordination Issue

For this language there are 407 translated files, with 379 TODO.

Playground

Done: 42, TODO: 47.

TSConfig Reference

Done: 117, TODO: 40.

Website copy

Done: 7, TODO: 6.

Documentation

Done: 5, TODO: 129.

Spanish Localization Coordination Issue

For this language there are 466 translated files, with 713 TODO.

Playground

Done: 23, TODO: 66.

TSConfig Reference

Done: 28, TODO: 129.

Website copy

Done: 8, TODO: 5.

Documentation

Done: 0, TODO: 134.

Korean Localization Coordination Issue

For this language there are 723 translated files, with 1242 TODO.

Playground

Done: 54, TODO: 35.

TSConfig Reference

Done: 36, TODO: 121.

Website copy

Done: 2, TODO: 11.

Documentation

Done: 60, TODO: 74.

the l18n entrance design not friendly or common

uTools_1657928826544

The l18n entrance displays in the lower right corner and only one native language. Instead of doing this, we put it in the top right corner with a drop-down menu to switch between different languages

How can the contributors notice the changes in English version?

How can the contributors notice the changes in English version,
so that the contributors can change the corresponding translations?

[Other references]

  • reactjs.org
  • kubernetes.io
    • All the languages (en, ko, ...) are managed in one repo: https://github.com/kubernetes/website
    • English-version-updating commits are merged to master.
    • Every two weeks, the l10n teams of each language (e.g. Korean) create a new dev branch from master, like
      • dev-1.20-ko.6 (Created on 2021-03-05 from master)
      • dev-1.20-ko.7 (Created on 2021-03-20 from master)
    • Since dev-1.20-ko.6 branch contains the Eng version of website source as of 2021-03-05,
    • and dev-1.20-ko.7 branch contains the Eng version of website source as of 2021-03-20,
    • comparing dev-1.20-ko.6 and dev-1.20-ko.7 shows the changes in English version.
    • Also, there is a script that checks if the English version of some localized contents have changed since a localized version has been committed.

French Localization Summary

For this language there are 954 translated files, with 2976 TODO.

Playground

Done: 7, TODO: 82.

TSConfig Reference

Done: 4, TODO: 153.

Website copy

Done: 12, TODO: 1.

Documentation

Done: 24, TODO: 110.

Chinese Localization Coordination Issue

For this language there are 571 translated files, with 1001 TODO.

Playground

Done: 48, TODO: 41.

TSConfig Reference

Done: 42, TODO: 115.

Website copy

Done: 8, TODO: 5.

Documentation

Done: 7, TODO: 127.

Still accept Chinese translation pr?

I noticed that pull requests for Chinese document translations have not been merged for at least a year. Based on other issues, it seems that the maintainers don't have enough time to do this.
Can we find other volunteers to complete this task?

Translation Recommendations

How To Contribute

  1. Join the TypeScript Discord - come say hi the ts-web-translate

  2. Follow the instructions on the README of this repo to get set up.

All Markdown Docs

Each translatable page is a unique markdown file which can be uniquely handled per language. Any markdown file not found will be replaced with English when not present.

Website

The website supports localization via React-intl, as of today only the navigation bar it translatable, but with time this will grow. The infra just came in with microsoft/TypeScript-Website#180

There are a series of keys and values for each language, with a fallback to English if you miss something. The TypeScript compiler will keep it all in check.

Playground

You can cover the examples in the dropdown in the playground (and in the site footer on desktops.) Full docs here

  • Make a subfolder with the code of the language in the copy folder of the 'playground-examples'
  • Ensure the filename are the same as English, (you can provide a different title via the JSON headers in the ts/js files)
  • Check out this folder
  • Ensure the filename is the same (we can provide a different title via the YML headers in the markdown files)

Recommendations

I'm pretty new to the translation game, but here's some notes from working with people so far on how translations can culturally work in the TS website.

Translate code to be a cultural fit. E.g.

const helloWorld = "Hi" 

to

const olaMundo = "Olá`

Translate names in example

const user =  { name: "John" }

to

const usar =  { name: "João" }

Note: we aim to have a diverse set of nationalities and genders in our examples, so I'd recommend not changing all of them, but try keep it feeling like it was written with that in mind also.

Translate Technical Terms, but keep English around

This one is nuanced, but a term like Mapped Type is the name for this:

type MyPartialType<Type> = {
  // For every existing property inside the type of Type
  // convert it to be a ?: version
  [Property in keyof Type]?: Type[Property];
};

So, if you translate it to "mapeada type", then provide a reference to the original name the first time it is used: "mapeada type (Mapped Type em inglês)" so that readers can know how to find the English resources on a topic.

[ko] Outdated Korean-translation files

  • docs/documentation/ko/project-config/Compiler Options in MSBuild.md
  • docs/documentation/ko/project-config/Compiler Options.md
    • Does not have noPropertyAccessFromIndexSignature (added in TS 4.2), and so on.
  • ...

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.