-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9b32bd0
Showing
31 changed files
with
1,639 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# MIT License | ||
|
||
Copyright (c) 2023 Maksym Stoianov | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<h1 align="center">Readme</h1> | ||
|
||
<div id="locales" align="center"> | ||
<a href="docs/bg/README.md"><img src="https://img.shields.io/badge/BG-grey?style=flat" alt="Български"></a> | ||
<a href="docs/de/README.md"><img src="https://img.shields.io/badge/DE-grey?style=flat" alt="Deutsch"></a> | ||
<a href="docs/en/README.md"><img src="https://img.shields.io/badge/EN-grey?style=flat" alt="English"></a> | ||
<a href="docs/ru/README.md"><img src="https://img.shields.io/badge/RU-grey?style=flat" alt="Русский"></a> | ||
<a href="docs/uk/README.md"><img src="https://img.shields.io/badge/UK-grey?style=flat" alt="Українська"></a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<h1 align="center">Security policy</h1> | ||
|
||
<div id="locales" align="center"> | ||
<a href="docs/bg/SECURITY.md"><img src="https://img.shields.io/badge/BG-grey?style=flat" alt="Български"></a> | ||
<a href="docs/de/SECURITY.md"><img src="https://img.shields.io/badge/DE-grey?style=flat" alt="Deutsch"></a> | ||
<a href="docs/en/SECURITY.md"><img src="https://img.shields.io/badge/EN-grey?style=flat" alt="English"></a> | ||
<a href="docs/ru/SECURITY.md"><img src="https://img.shields.io/badge/RU-grey?style=flat" alt="Русский"></a> | ||
<a href="docs/uk/SECURITY.md"><img src="https://img.shields.io/badge/UK-grey?style=flat" alt="Українська"></a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<div id="locales" align="right"> | ||
<a href="../bg/CHANGELOG.md"><img src="https://img.shields.io/badge/BG-blue?style=flat" alt="Български"></a> | ||
<a href="../de/CHANGELOG.md"><img src="https://img.shields.io/badge/DE-grey?style=flat" alt="Deutsch"></a> | ||
<a href="../en/CHANGELOG.md"><img src="https://img.shields.io/badge/EN-grey?style=flat" alt="English"></a> | ||
<a href="../ru/CHANGELOG.md"><img src="https://img.shields.io/badge/RU-grey?style=flat" alt="Русский"></a> | ||
<a href="../uk/CHANGELOG.md"><img src="https://img.shields.io/badge/UK-grey?style=flat" alt="Українська"></a> | ||
</div> | ||
|
||
|
||
# Changelog | ||
|
||
|
||
## [1.1.2] - 2024-08-16 | ||
|
||
### Подобрения | ||
* Подобрена документация на JSDoc за по-голяма яснота и детайлност. | ||
|
||
### Корекции | ||
* Решени са различни грешки и проблеми. | ||
|
||
|
||
## [1.0.0] - 2023-10-29 | ||
|
||
* Първоначална версия. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div id="locales" align="right"> | ||
<a href="../bg/CONTRIBUTING.md"><img src="https://img.shields.io/badge/BG-blue?style=flat" alt="Български"></a> | ||
<a href="../de/CONTRIBUTING.md"><img src="https://img.shields.io/badge/DE-grey?style=flat" alt="Deutsch"></a> | ||
<a href="../en/CONTRIBUTING.md"><img src="https://img.shields.io/badge/EN-grey?style=flat" alt="English"></a> | ||
<a href="../ru/CONTRIBUTING.md"><img src="https://img.shields.io/badge/RU-grey?style=flat" alt="Русский"></a> | ||
<a href="../uk/CONTRIBUTING.md"><img src="https://img.shields.io/badge/UK-grey?style=flat" alt="Українська"></a> | ||
</div> | ||
|
||
|
||
# Как да станете участник? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div id="locales" align="right"> | ||
<a href="../bg/LICENSE.md"><img src="https://img.shields.io/badge/BG-blue?style=flat" alt="Български"></a> | ||
<a href="../de/LICENSE.md"><img src="https://img.shields.io/badge/DE-grey?style=flat" alt="Deutsch"></a> | ||
<a href="../en/LICENSE.md"><img src="https://img.shields.io/badge/EN-grey?style=flat" alt="English"></a> | ||
<a href="../ru/LICENSE.md"><img src="https://img.shields.io/badge/RU-grey?style=flat" alt="Русский"></a> | ||
<a href="../uk/LICENSE.md"><img src="https://img.shields.io/badge/UK-grey?style=flat" alt="Українська"></a> | ||
</div> | ||
|
||
|
||
# MIT License | ||
|
||
Copyright (c) 2023 Maksym Stoianov | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
<div id="locales" align="right"> | ||
<a href="../bg/README.md"><img src="https://img.shields.io/badge/BG-blue?style=flat" alt="Български"></a> | ||
<a href="../de/README.md"><img src="https://img.shields.io/badge/DE-grey?style=flat" alt="Deutsch"></a> | ||
<a href="../en/README.md"><img src="https://img.shields.io/badge/EN-grey?style=flat" alt="English"></a> | ||
<a href="../ru/README.md"><img src="https://img.shields.io/badge/RU-grey?style=flat" alt="Русский"></a> | ||
<a href="../uk/README.md"><img src="https://img.shields.io/badge/UK-grey?style=flat" alt="Українська"></a> | ||
</div> | ||
|
||
|
||
# I18nService | ||
|
||
<div id="badges" align="left"> | ||
<img src="https://img.shields.io/github/v/release/MaksymStoianov/I18nService" alt="Release"> | ||
<a href="LICENSE.md"><img src="https://img.shields.io/github/license/MaksymStoianov/I18nService" alt="License"></a> | ||
<a href="https://github.com/google/clasp"><img src="https://img.shields.io/badge/built%20with-clasp-4285f4.svg" alt="clasp"></a> | ||
</div> | ||
|
||
**I18nService** е обект, който реализира работа с интернационализация. | ||
|
||
|
||
## Инсталация | ||
|
||
1. Отворете своя проект в [Google Apps Script Dashboard](https://script.google.com/). | ||
2. Копирайте съдържанието на файла [i18n.js](../../src/i18n.js) и го поставете в нов файл във вашия проект в Google Apps Script. | ||
|
||
|
||
## Употреба | ||
|
||
### Пример 1 | ||
|
||
```javascript | ||
const data = { | ||
"bg": { | ||
title: "Тестово приложение" | ||
}, | ||
"de": { | ||
title: "Testanwendung" | ||
}, | ||
"en": { | ||
title: "Example Application" | ||
}, | ||
"ru": { | ||
title: "Тестовое приложение" | ||
}, | ||
"uk": { | ||
title: "Тестовий застосунок" | ||
} | ||
}; | ||
|
||
const i18n = I18nService | ||
.init('bg') | ||
.load(data); | ||
|
||
console.log(i18n.getLanguage('bg').getTranslate('title')); | ||
console.log(__('title')); | ||
``` | ||
|
||
### Пример 2 | ||
|
||
```javascript | ||
const data = { | ||
title: "Example Application" | ||
}; | ||
const locale = "bg"; | ||
|
||
const i18n = I18nService | ||
.init(locale) | ||
.load(data, locale); | ||
|
||
console.log(i18n.getLanguage(locale).getTranslate('title')); | ||
console.log(__('title')); | ||
``` | ||
|
||
### Пример 3 | ||
|
||
```javascript | ||
const sheet = SpreadsheetApp | ||
.getActiveSpreadsheet() | ||
.getSheetByName('I18n'); | ||
|
||
const i18n = I18nService | ||
.init('bg') | ||
.load(sheet); | ||
|
||
console.log(i18n.getLanguage('bg').getTranslate('title')); | ||
console.log(__('title')); | ||
``` | ||
|
||
|
||
## Задачи | ||
|
||
- [ ] Добавете в метода `I18n.load()` възможността за зареждане на преводи `json` чрез url-връзка. | ||
- [ ] Използвайте [`CacheService`](https://developers.google.com/apps-script/reference/cache) за съхранение на езика. | ||
|
||
|
||
## Принос | ||
|
||
Моля, прочетете [CONTRIBUTING.md](CONTRIBUTING.md) за подробности относно това как да допринесете за този проект. | ||
|
||
|
||
## История на промените | ||
|
||
Моля, направете справка с [CHANGELOG.md](CHANGELOG.md) за подробен списък на промените и актуализациите. | ||
|
||
|
||
## Лиценз | ||
|
||
Този проект е лицензиран съгласно файла [LICENSE.md](LICENSE.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div id="locales" align="right"> | ||
<a href="../bg/SECURITY.md"><img src="https://img.shields.io/badge/BG-blue?style=flat" alt="Български"></a> | ||
<a href="../de/SECURITY.md"><img src="https://img.shields.io/badge/DE-grey?style=flat" alt="Deutsch"></a> | ||
<a href="../en/SECURITY.md"><img src="https://img.shields.io/badge/EN-grey?style=flat" alt="English"></a> | ||
<a href="../ru/SECURITY.md"><img src="https://img.shields.io/badge/RU-grey?style=flat" alt="Русский"></a> | ||
<a href="../uk/SECURITY.md"><img src="https://img.shields.io/badge/UK-grey?style=flat" alt="Українська"></a> | ||
</div> | ||
|
||
|
||
# Докладване на проблем със сигурността |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<div id="locales" align="right"> | ||
<a href="../bg/CHANGELOG.md"><img src="https://img.shields.io/badge/BG-grey?style=flat" alt="Български"></a> | ||
<a href="../de/CHANGELOG.md"><img src="https://img.shields.io/badge/DE-blue?style=flat" alt="Deutsch"></a> | ||
<a href="../en/CHANGELOG.md"><img src="https://img.shields.io/badge/EN-grey?style=flat" alt="English"></a> | ||
<a href="../ru/CHANGELOG.md"><img src="https://img.shields.io/badge/RU-grey?style=flat" alt="Русский"></a> | ||
<a href="../uk/CHANGELOG.md"><img src="https://img.shields.io/badge/UK-grey?style=flat" alt="Українська"></a> | ||
</div> | ||
|
||
|
||
# Changelog | ||
|
||
|
||
## [1.1.2] - 2024-08-16 | ||
|
||
### Erweiterungen | ||
* Verbesserte JSDoc-Dokumentation für mehr Klarheit und Detailgenauigkeit. | ||
|
||
### Korrekturen | ||
* Verschiedene Bugs und Probleme wurden behoben. | ||
|
||
|
||
## [1.0.0] - 2023-10-29 | ||
|
||
* Erste Veröffentlichung. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div id="locales" align="right"> | ||
<a href="../bg/CONTRIBUTING.md"><img src="https://img.shields.io/badge/BG-grey?style=flat" alt="Български"></a> | ||
<a href="../de/CONTRIBUTING.md"><img src="https://img.shields.io/badge/DE-blue?style=flat" alt="Deutsch"></a> | ||
<a href="../en/CONTRIBUTING.md"><img src="https://img.shields.io/badge/EN-grey?style=flat" alt="English"></a> | ||
<a href="../ru/CONTRIBUTING.md"><img src="https://img.shields.io/badge/RU-grey?style=flat" alt="Русский"></a> | ||
<a href="../uk/CONTRIBUTING.md"><img src="https://img.shields.io/badge/UK-grey?style=flat" alt="Українська"></a> | ||
</div> | ||
|
||
|
||
# Wie wird man ein Beitragszahler? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div id="locales" align="right"> | ||
<a href="../bg/LICENSE.md"><img src="https://img.shields.io/badge/BG-grey?style=flat" alt="Български"></a> | ||
<a href="../de/LICENSE.md"><img src="https://img.shields.io/badge/DE-blue?style=flat" alt="Deutsch"></a> | ||
<a href="../en/LICENSE.md"><img src="https://img.shields.io/badge/EN-grey?style=flat" alt="English"></a> | ||
<a href="../ru/LICENSE.md"><img src="https://img.shields.io/badge/RU-grey?style=flat" alt="Русский"></a> | ||
<a href="../uk/LICENSE.md"><img src="https://img.shields.io/badge/UK-grey?style=flat" alt="Українська"></a> | ||
</div> | ||
|
||
|
||
# MIT License | ||
|
||
Copyright (c) 2023 Maksym Stoianov | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.