Provide website translation


#1

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.


#2

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.


#3

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.


#4

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


#5

patience is you friend :slight_smile:


#6

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

https://docs.ghost.org/concepts/architecture/

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:

https://github.com/TryGhost/Ghost-Admin

Most interesting link for you is there

https://docs.ghost.org/install/source/

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

https://stackoverflow.com/a/52806470/6398044

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


#7

Before spending a lot of time trying to translate files in the Ghost-Admin app please read responses to previous PRs such as https://github.com/TryGhost/Ghost-Admin/pull/1017#issuecomment-420310841

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


#8

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.


closed #9

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