Provide website translation

I am a Ghost user from China. When I visited the website of the Ghost Foundation, I found a problem. Most websites can’t provide complete translations, and even some websites don’t provide translations at all, such as the community. This is very unfriendly for users whose native language is not English. I think if I can assist Ghost’s admin to complete the Chinese translation, I hope you can give me a chance to help Chinese users and myself.

Why does admin answer most of the topics after me?But they didn’t answer me, they didn’t even say no.I think my request is meaningful and I hope to get a response from admin.

Please remember that any developer also has their own schedule. Right now it’s weekend, and they might not be active in the weekend. Allow them some free time.

Please also remember that ghost is open-source, and needs to pay their developers.

Maybe I’m too anxious.And i will wait patiently for a reply.

patience is you friend :slight_smile:

If I understood intentions of creators of this platform ghost admin is only client app.

Ghost Architecture – A modern, decoupled web application for professional publishers

And further development will go in direction of make possible to build your own admin panel and connect it with core. It is the reason why I joined to this community. If I wrong and plan of development is other, please fix me.

Now repository with admin client is there:

GitHub - TryGhost/Admin: Ghost's admin client

Most interesting link for you is there

Ghost Docs

Templates to translate are there

https://github.com/TryGhost/Ghost-Admin/tree/master/app/templates

and as you can see look at example of file

https://github.com/TryGhost/Ghost-Admin/blob/master/app/templates/settings/integrations/zapier.hbs

Texts are hardcoded. If you want to translate it you should change any element

<tagName>EnglishText</tagName>

to

<tagName data-text="EnglishText">EnglishText</tagName>

You can select name like data-trans instead of data-text.

then append script that will check:

  • if user language saved for example in local storage is zh
  • if yes then find all elements with data-text and change his innerText to text from your translation

Example of code with full explanation is here

javascript - Change language attribute value in all redirections without use hreflang attribute in links - Stack Overflow

It is important to no remove EnglishText from tagName due to efficiency reasons. It is important to do not save language to database, because we do not want change structure of database. Use local storage.

The best method to prepare translations would be typing script that will convert all tags to format containing translation tag. This script should be introduced to development process and should create jsons with translations.

@scvoet do you think you can create pull requests with described changes?

Question to core dev team of ghost. What do you think about this proposition? Are you going to accept changes like these?

Reference

https://coderwall.com/p/c4-8ka/ember-js-translations-with-bindings

Before spending a lot of time trying to translate files in the Ghost-Admin app please read responses to previous PRs such as i18n support by ololoken · Pull Request #1017 · TryGhost/Admin · GitHub

(FYI, that PR also has a somewhat correct way to do translation in an ember.js app rather than what was described by above)

Wow, so if it is done in this repository

https://github.com/ololoken/Ghost-Admin/blob/master/app/templates/settings/integrations/zapier.hbs

So @scvoet you have a much simpler task: create zh directory in the fork:

https://github.com/ololoken/Ghost-Admin/tree/master/app/locales

I agree with the opinion that maintaining many languages complicates development. Thank @Kevin for indicating this fork.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.