yhdgms1 / novely

Engine that will let you create interactive stories with ease
https://novely.deno.dev
ISC License
19 stars 3 forks source link

Translations #5

Closed yhdgms1 closed 1 year ago

yhdgms1 commented 1 year ago

At the moment, the @novely/t9n module is used for translation. It does not require the initial translation values.

yhdgms1 commented 1 year ago

I think the following should be done:

Like

const { t, te /** better name needed */ } = novely(...);

t('internal:Settings') // ok
te('internal:Settings') // error

t('User translation key') // ok
te('User translation key') // ok

or keep t for user translations, and create a ti - translate internal or use t, and i

const { t, i } = novely({
  t9n: createT9N({
    ru: {
      pluralization: {},
      internal: {
        ...RU_TRANSLATION,
        'Settings': 'Открыть Настройки'
      },
      strings: {
        'Settings': 'Что-то не связанное с Novely'
      }
    },
  }),
});

t('Settings') // 'Что-то не связанное с Novely'
i('Settings') // 'Открыть Настройки'
yhdgms1 commented 1 year ago

Снова должна быть изменена система сохранений - язык должен храниться отдельно от сохранения, также требуется сделать функцию novely асинхронной, т.к. для получения языка должна выполняться асинхронная операция, или можно придумать другой способ отрисовки после получения языка.

yhdgms1 commented 1 year ago

This is Done now, however the only renderer is not done yet.