Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization of the webpage #197

Closed
awvwgk opened this issue Feb 7, 2021 · 20 comments
Closed

Localization of the webpage #197

awvwgk opened this issue Feb 7, 2021 · 20 comments
Labels
i18n Related to internationalisation and translations

Comments

@awvwgk
Copy link
Member

awvwgk commented Feb 7, 2021

Is there a way we can offer localization with the current website design? What would we have to do from a technical point of view to be able to put up a localized version of fortran-lang.org?

Inspired by @vmagnin's post at https://fortran-lang.discourse.group/t/promoting-fortran-in-non-english-languages/678

@certik
Copy link
Member

certik commented Feb 8, 2021

Yes I think that is a good idea, as long as people are willing to maintain the translations. Here is how we do it in for the SymPy's webpage:

https://github.com/sympy/sympy.github.com#translations

@vmagnin
Copy link
Member

vmagnin commented Feb 8, 2021

As written in the Discourse, if translating pages is decided, I of course agree to work on the french translation. And of course, it could be a collaborative work if there is other people interested here.

@awvwgk
Copy link
Member Author

awvwgk commented Feb 8, 2021

@vmagnin Definitely, I consider it more a matter of figuring out the technicalities to get this running with jekyll. I already found plenty of ugly solutions when searching for jekyll i18n, but nothing that strikes me as elegant and simple yet.

On this topic, I would contribute to German translations.

@awvwgk awvwgk added the i18n Related to internationalisation and translations label Feb 8, 2021
@vmagnin
Copy link
Member

vmagnin commented Feb 8, 2021

Definitely, I consider it more a matter of figuring out the technicalities to get this running with jekyll.

Yes, the main problem is probably a technical one. How to transform the site into a multi-language site... It seems not trivial... And would probably need a lot of work.

@vmagnin
Copy link
Member

vmagnin commented Feb 8, 2021

Maybe we could, at least as a first step, just translate the homepage. Perhaps it would be sufficient to make the site appears in Google with a good pagerank. I don't know if the number of pages available in the national language is taken into account in the Google algorithm... We could even make an experiment: we translate the homepage just in one language, and we wait some days (or weeks ?) to see if it has an effect on search engines.
And I guess that once people have found the website, most will be able to understand something in the english pages.

@awvwgk
Copy link
Member Author

awvwgk commented Feb 8, 2021

I found jekyll-multiple-languages-plugin which allows side localization with jekyll in an elegant way. First, I already created a branch i18n, where you can give it a try.

  1. add your language in the _config.yml under languages (the first language is the default)

languages: ["en"]

  1. create the file _i18n/<lang>.yml and the directory _i18n/<lang> (now you can visit http://127.0.0.1:4000/<lang>/ already, untranslated pages are taken from the default language branch)
  2. mirror the content of _i18n/en in your _i18n/<lang> directory, i.e. create _i18n/<lang>/index.html to translate the main page

There are a lot of small details I still have to figure out, but this basically looks like a suitable solution for the webpage.

@vmagnin
Copy link
Member

vmagnin commented Feb 9, 2021

3. mirror the content of `_i18n/en` in your `_i18n/<lang>` directory, _i.e._ create `_i18n/<lang>/index.html` to translate the main page

@awvwgk , I have forked your repository. I will try these days to translate just the homepage to begin. Just a question concerning your third point: should I mirror all the content of _i18n/en ? or just the files I want to translate ? (it's what I understand, but I am not sure...)

Another newbie question: I guess that to access to http://127.0.0.1:4000/<lang>/ I need to install jekyll on my machine? (seems to be available in Ubuntu)

@awvwgk
Copy link
Member Author

awvwgk commented Feb 9, 2021

@vmagnin Just adding the files you translate is sufficient, the rest will be filled in automatically from the _i18n/en tree. Let me know if this works as expected. Note, currently my setup only allows to translate the body but not the keywords in the header and footer and so on, but I will look into this soon.

To setup the webpage locally follow the guide in the README at https://github.com/fortran-lang/fortran-lang.org#setup. After you have setup everything run bundle exec jekyll serve --watch in another terminal and open http://127.0.0.1:4000 in your webbrowser to get a live preview while you edit the content.

@aslozada
Copy link
Member

aslozada commented Feb 9, 2021

This procedure works correctly. Jekyll server returns some warnings about deprecated arguments.

fortran-lang.org/.bundle/ruby/2.7.0/gems/jekyll-3.8.6/lib/jekyll/tags/include.rb:194: warning: Using the last argument as keyword parameters is deprecated

I am trying with a Spanish translation

@vmagnin
Copy link
Member

vmagnin commented Feb 9, 2021

I have done everything, including _i18n/fr.yml and _i18n/fr/index.html
I can access to my local english version, but not the french version with http://127.0.0.1:4000/fr/ in my web browser:
Not Found
`/fr/' not found.
WEBrick/1.6.0 (Ruby/2.7.1/2020-03-31) at 127.0.0.1:4000

Should I install jekyll-multiple-languages-plugin with bundle ? I don't see it when I type "bundle install" (but I see Installing i18n 0.9.5)

@vmagnin
Copy link
Member

vmagnin commented Feb 9, 2021

Sorry, my second terminal (the jekyll one) was not opened in the i18n but the master branch...
Now bundle install successfully installed the jekyll-multiple-languages-plugin
It's OK, I have translated one sentence and I see it in http://127.0.0.1:4000/fr/
:-)

@awvwgk
Copy link
Member Author

awvwgk commented Feb 10, 2021

I put together a first draft patch for the localized homepage at #201, if you want to give it a try, there is now support for localizing (most of the) keywords in the navigation and footer and adding translated pages. The process is outlined here.

It has still a few plenty rough edges, so feedback is much appreciated. Stay tuned.

@aslozada
Copy link
Member

Would it appropriate build a branch to each language during translation process?

e.g.

i81n
|
| -- Default language
| -- English
| -- Spanish
| -- French
| -- German
| -- Czech
...

@aslozada
Copy link
Member

I put together a first draft patch for the localized homepage at #201, if you want to give it a try, there is now support for localizing (most of the) keywords in the navigation and footer and adding translated pages. The process is outlined here.

It has still a few plenty rough edges, so feedback is much appreciated. Stay tuned.

@awvwgk. If the general layout (_i18n /_layouts) is kept fixed, the final aspect of the footer is modified by adding words with a greater number of characters. Some "line breaks" are introduced.

@vmagnin
Copy link
Member

vmagnin commented Feb 11, 2021

Would it appropriate build a branch to each language during translation process?

In my opinion, it is not necessary, each language having its own directory. And it would multiply the number of branches in the project.

@aslozada
Copy link
Member

I put together a first draft patch for the localized homepage at #201, if you want to give it a try, there is now support for localizing (most of the) keywords in the navigation and footer and adding translated pages. The process is outlined here.
It has still a few plenty rough edges, so feedback is much appreciated. Stay tuned.

@awvwgk. If the general layout (_i18n /_layouts) is kept fixed, the final aspect of the footer is modified by adding words with a greater number of characters. Some "line breaks" are introduced.

Thanks, @vmagnin. Yes, my comment is a bit confusing.
Perhaps the following images describe better,

Footer in the English version
english

Footer in the Spanish version
spanish

@awvwgk
Copy link
Member Author

awvwgk commented Feb 11, 2021

I see, yes they are currently just 33% of the column wide. If we will have many languages there might be even problems with the language keys. I will probably try two rows in the footer instead.

@vmagnin
Copy link
Member

vmagnin commented Feb 11, 2021

@aslozada , no, not confusing. My emoji was just meaning I have the same annoying (minor) problem. In my case, even for the GitHub message on the right.

@awvwgk
Copy link
Member Author

awvwgk commented Feb 11, 2021

I made a second line for the languages, if we get many translations and small screens (mobile) line breaks can't be avoided, but this is something to worry about once we have that much translations:

image

@awvwgk awvwgk linked a pull request Feb 21, 2021 that will close this issue
10 tasks
@awvwgk
Copy link
Member Author

awvwgk commented Aug 6, 2022

This issue will be resolved with the migration to the new webpage at https://github.com/fortran-lang/webpage (see #415).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n Related to internationalisation and translations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants