You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the new website is being built out bit-by-bit, we're adding support for internationalized content on a per-section basis. I've been working with l33t speak under the language "vo" to test out the infra as it is built.
I expect there are (at least) four main components for creating content on a per-language basis:
Website copy (navigation bar, index page, community page etc)
Clone the repo. The work will happen on the v2 branch. Deploys of the TS website have this static site set up at http://www.typescriptlang.org/v2/
git clone https://github.com/microsoft/TypeScript-Website
cd TypeScript-Website
code .
code README.md
# Follow setup instructions in README# then start up the server
yarn start
Look below to see the sections, then come back up here
Pick one of the below sections to start with, it might be easiest to work with samples in the Playground first FWIW.
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 #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
Ensure the filename are the same as English, (you can provide a different title via the JSON headers in the ts/js files)
TSConfig
Each TSConfig file is a unique markdown file which can be uniquely handled per language. Any markdown file not found will be replaced with English. Full docs here
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.
consthelloWorld="Hi"
to
constolaMundo= "Olá`
Translate names in example
constuser={name: "John"}
to
constusar={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:
typeMyPartialType<Type>={// For every existing property inside the type of Type// convert it to be a ?: version[PropertyinkeyofType]?: 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.
As the new website is being built out bit-by-bit, we're adding support for internationalized content on a per-section basis. I've been working with l33t speak under the language "vo" to test out the infra as it is built.
I expect there are (at least) four main components for creating content on a per-language basis:
Each one of these needs:
Current state of internationalization:
Website copy.
Website content (e.g. the handbook).
Playground examples:
TSConfig:
How To Contribute
Join the TypeScript Discord - come say hi the
ts-web-translateClone the repo. The work will happen on the
v2branch. Deploys of the TS website have this static site set up at http://www.typescriptlang.org/v2/Look below to see the sections, then come back up here
Read this PR to see an example of adding a language: Create an example PR which shows how to add a language #181
Pick one of the below sections to start with, it might be easiest to work with samples in the Playground first FWIW.
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 #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
TSConfig
Each TSConfig file is a unique markdown file which can be uniquely handled per language. Any markdown file not found will be replaced with English. Full docs here
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.
to
Translate names in example
to
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 Typeis the name for this: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.