fictionco / fiction

(Public Release Summer 2024) Personal Marketing Platform. A powerful platform for your online identity.

Home Page:https://www.fiction.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is it possible to translate the dashboard? :)

lindamacdonald opened this issue · comments

Reason for this issue
Hey there :) great project!! I had a browse through the docs and it said to fork a repo in case we wanted to contribute. I would like to contribute with a norwegian translation in case you don't already have one for the dashboard?

Steps to Reproduce

Just putting my two cents... As a developer who only submits issues and occassional PRs. Dashboard is currently coded in a way, in which it does not support multiple languages. So currently translations aren't an easy thing and the best thing to do is to fork the dashboard module and add the translations yourself without merging them with the codebase.

Or extend the Dashboard module to support i18n-like language changes...

Since I am not part of the core team, I cannot hereby say whether it is planned with v2 revision of Factor as well.

Primarily, the dashboard needs to embed all text into factor-settings.ts

The most obvious solutions that I can think of are two.

  • expand factor-settings.ts to support translated setting files (say factor-settings.en_US.ts, which will replace all defined settings in factor-settings.ts under condition, the language is set to en_US, so if key is defined in en_US, it uses that instead of the one in base file, but if the key is not defined in en_US, it defaults back to main file). This is extremely similar to i18n specification. Depending whether the installation is mono-lingual or multi-lingual has a "difficulty" to develop such feature. Mono-lingual can be easily rewritten, multilingual would require more than a simple modification in the build routine...
  • simply embed language key on the root level of factor-settings and setting receives a special internal command that uses the language. This is a quick and dirty hack...

I don't have any other ideas, I am merely basing myself off the experience I have with Java, that I also use at work 😅

Like any good architecture, enable hook to transform text: by language, context or by a11y (additional text for reader).
Hooks run in Drupal, Wordpress and Prestashop and are key to success for this project too :)
Any "override" is problematic in module level as this duplicate efford to translate same text over and over again.
I think that hook can be used in may more scenario in future - text can be changed in live according of change as well according setting or to check spelling (new module on top of that hook)