Proper directory setup for localized .md files for pxt-target
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 641
- Avg merge
- 12h 4m
- Merged PRs (30d)
- 57
Description
Hi
I am implementing a new pxt target with exapmles and tutorials basing on the "pxt-sample" repository. I created new Gallery "tutorials" and a following tutorials.md and file in the doc directory:
# Tutorials
## Fun stuff
[{
"name": "T 1",
"description": "O 1",
"url":"/tutorials/tutorial1",
"cardType": "tutorial"
}, {
"name": "T 2",
"description": "O 2",
"url": "/tutorials/tutorial2",
"cardType": "tutorial"
}]
tutorial1.md and tutorial2.md are files in the /doc directory.
Everything works fine and tutorials display and run properaly.
The problem is with the localization. I've added lozalization files to the /libs/core/_locales/[language_code]. Both .jsons and localized versions of tutorial1.md and tutorial2.md. (According to this documentation https://makecode.com/writing-docs/user-tutorials ) The string from .json files are implemented propearly when i change the language setting, but the .md files are still taken from the /docs folder. What is the proper way to set the directories and files for the localized .md files? I know this is possible since the microbit target supports it for some languages, but i just do not know how to do it right?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the localized files under /libs/core/_locales/[language_code] with the tutorial1.md and tutorial2.md files under /doc, then review the user-tutorials documentation and the pxt-sample repository setup. Check how the microbit target arranges localized Markdown. Done means the localized tutorial files are selected when the language setting changes, while the JSON strings continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation, localization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100