Git Product home page Git Product logo

i18n's Introduction

i18n's People

Contributors

nitreojs avatar

Stargazers

 avatar  avatar

Watchers

 avatar

i18n's Issues

Пустой массив при запросе .getLanguages(), если не вызван ни один перевод.

Вся проблема заключается в том, что .loadDictionaries() вызывается лишь при ручной смене переменных или вызове "перевода", но НЕ при инициализации.

При инициализации:

image

image

Если всеми правдами-неправдами вызвать .loadDictionaries() (костыль решение)

image

image

Фаллбек скриптового кода языка

Как сказано где-то там Codes of the form ll-Xxxx combine an ISO 639-1 language code (two letters) and an ISO 15924 script code (four letters). BCP 47 recommends that language codes be written in lower case and that script codes be written "lowercase with the initial letter capitalized", but this is basically for readability.

И условно есть

  • zh (в телеграме такого языка нет) — в целом подраздел "китайский язык"
  • zh-hans (в телеграме есть) — китайский упрощенный
  • zh-hant (в телеграме есть) — китайский традиционный

Моя идея заключается в том, что если нет переводчиков для обоих типов языка, а есть условно для zh-hans -> админ на свой страх и риск ренеймит его в zh, и при отсутствии zh-hant (как и zh-hans) оно фаллбекается в zh

Поддержка неполного перевода

Фактически, большинство проектов используют свою аудиторию для того, чтоб добавлять поддержку других языков с помощью сервисов по типу Crowdin

И, условно, 100% перевод большого проекта с 20+ строками для перевода (при условии, что аудитория у проекта маленькая) может растянуться на неопределенное время и лишь постепенно заполнятся.

Моя идея заключается в том, чтоб сделать fallbackLanguage, который будет отрабатывать в том случае, если конкретная строка перевода не найдена

Текущая логика: 'some.path' (ru) -> [not found. but exists in fallback / default locale] -> returns raw key 'some.path'
Предлагаю: 'some.path' (ru) -> [not found, but exists in fallback / default locale] -> 'Some Translated String' (en) -> [если не найдено] -> returns raw key 'some.path'

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.