|
1 | | -# The JavaScript Tutorial |
| 1 | +# The Modern JavaScript Tutorial in Persian (Farsi) |
2 | 2 |
|
3 | | -[](https://gitter.im/javascript-tutorial-fa/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
| 3 | +This repository hosts the translation of <https://javascript.info> in Persian (Farsi). |
4 | 4 |
|
5 | | -This repository hosts Persian edition of the Modern JavaScript Tutorial, published at [https://javascript.info](https://javascript.info). |
| 5 | +**That's how you can contribute:** |
6 | 6 |
|
| 7 | +- See the [Persian (Farsi) Translate Progress](https://github.com/javascript-tutorial/fa.javascript.info/issues/1) issue. |
| 8 | +- Choose an unchecked article you'd like to translate. |
| 9 | +- Add a comment with copy-pasted article title to the issue. Our bot will mark it, for everyone to know that you're translating it. |
| 10 | + - The comment should only contain the article title. |
| 11 | +- Fork the repository, translate and send a PR when done. |
| 12 | + - PR title should match article title, for our bot to track your progress. |
| 13 | + |
| 14 | +**Let others know what you're translating, in message boards or chats in your language. Invite them to join!** |
| 15 | + |
| 16 | +🎉 Thank you! |
| 17 | + |
| 18 | +Your name and the contribution size will appear in the "About project" page when the translation gets published. |
| 19 | + |
| 20 | +If you'd like to join as a maintainer, write us at <https://github.com/javascript-tutorial/en.javascript.info/issues/new>. |
| 21 | + |
| 22 | +P.S. The full list of languages can be found at <https://javascript.info/translate>. |
| 23 | + |
| 24 | +## Structure |
| 25 | + |
| 26 | +Every chapter, an article or a task resides in its own folder. |
| 27 | + |
| 28 | +The folder is named `N-url`, where `N` – is the number for sorting (articles are ordered), and `url` is the URL-slug on the site. |
| 29 | + |
| 30 | +The folder has one of files: |
| 31 | + |
| 32 | +- `index.md` for a section, |
| 33 | +- `article.md` for an article, |
| 34 | +- `task.md` for a task formulation (+`solution.md` with the solution text if any). |
| 35 | + |
| 36 | +A file starts with the `# Title Header`, and then the text in Markdown-like format, editable in a simple text editor. |
| 37 | + |
| 38 | +Additional resources and examples for the article or the task, are also in the same folder. |
| 39 | + |
| 40 | +## Translation Tips |
| 41 | + |
| 42 | +Please keep line breaks and paragraphs "as is": don't add newlines and don't remove existing ones. Makes it easy to merge future changes from the English version into the translation. |
| 43 | + |
| 44 | +If you see that the English version can be improved – great, please send a PR to it. |
| 45 | + |
| 46 | +### Terms |
| 47 | + |
| 48 | +- Some specification terms are not to be translated, e.g. "Function Declaration" can be left "as is". |
| 49 | +- For other terms like `resolved promise`, `slash`, `regexp`, and so on look a good glossary, hopefully there's one for your language already. |
| 50 | + - If there's no dictionary, look for translations in manuals, such as [MDN](https://developer.mozilla.org/en-US/). |
| 51 | + |
| 52 | +### Text in Code Blocks |
| 53 | + |
| 54 | +- Translate comments. |
| 55 | +- Translate user-messages and example strings. |
| 56 | +- Don't translate variables, classes, identifiers. |
| 57 | +- Ensure that the code works after the translation :) |
| 58 | + |
| 59 | +Example: |
| 60 | + |
| 61 | +```js |
| 62 | +// Example |
| 63 | +const text = "Hello, world"; |
| 64 | +document.querySelector('.hello').innerHTML = text; |
| 65 | +``` |
| 66 | + |
| 67 | +✅ DO (translate comment): |
| 68 | + |
| 69 | +```js |
| 70 | +// Ejemplo |
| 71 | +const text = 'Hola mundo'; |
| 72 | +document.querySelector('.hello').innerHTML = text; |
| 73 | +``` |
| 74 | + |
| 75 | +❌ DON'T (translate class): |
| 76 | + |
| 77 | +```js |
| 78 | +// Ejemplo |
| 79 | +const text = 'Hola mundo'; |
| 80 | +// ".hello" is a class |
| 81 | +// DO NOT TRANSLATE |
| 82 | +document.querySelector('.hola').innerHTML = text; |
| 83 | +``` |
| 84 | + |
| 85 | +### External Links |
| 86 | + |
| 87 | +If an external link is to Wikipedia, e.g. `https://en.wikipedia.org/wiki/JavaScript`, and a version of that article exists in your language that is of decent quality, link to that version instead. |
| 88 | + |
| 89 | +Example: |
| 90 | + |
| 91 | +```md |
| 92 | +[JavaScript](https://en.wikipedia.org/wiki/JavaScript) is a programming language. |
| 93 | +``` |
| 94 | + |
| 95 | +✅ OK (en -> es): |
| 96 | + |
| 97 | +```md |
| 98 | +[JavaScript](https://es.wikipedia.org/wiki/JavaScript) es un lenguaje de programación. |
| 99 | +``` |
| 100 | + |
| 101 | +For links to MDN, a partially translated version is ok. |
| 102 | + |
| 103 | +If a linked article has no translated version, leave the link "as is". |
| 104 | + |
| 105 | +### Metadata |
| 106 | + |
| 107 | +Some files, usually tasks, have YAML metadata at the top, delimited by `---`: |
| 108 | + |
| 109 | +```md |
| 110 | +importance: 5 |
| 111 | + |
| 112 | +--- |
| 113 | +... |
| 114 | +``` |
| 115 | + |
| 116 | +Please don't translate "importance" (and other top metadata). |
| 117 | + |
| 118 | +### Anchors |
| 119 | + |
| 120 | +Some headers have `[#anchor]` at the end, e.g. |
| 121 | + |
| 122 | +```md |
| 123 | +## Spread operator [#spread-operator] |
| 124 | +``` |
| 125 | + |
| 126 | +Please don't translate or remove the `[#...]` part, it's for URL anchors. |
| 127 | + |
| 128 | +## Running locally |
| 129 | + |
| 130 | +You can run the tutorial locally to immediately see the changes. |
| 131 | + |
| 132 | +The server is at <https://github.com/javascript-tutorial/server>. |
0 commit comments