Skip to content

Draft: Internationalization for fortran-lang #201

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

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f14c12f
Initial scaffold for localization
awvwgk Feb 8, 2021
2ad21fa
Localize keywords and phrases in navigation bars and footers
awvwgk Feb 9, 2021
c3c5cae
Add a short introduction on translating
awvwgk Feb 10, 2021
721eab2
Localize leftover keywords
awvwgk Feb 11, 2021
d1e092a
Separate content from markup on the main page
awvwgk Feb 14, 2021
8ec2b25
Separate content from markup for other subpages as well
awvwgk Feb 14, 2021
a4b7f29
Localize page titles
awvwgk Feb 14, 2021
6022333
Fix typo in site preview header...
awvwgk Feb 14, 2021
27d5f46
Update translating guide
awvwgk Feb 14, 2021
49ab6ab
Localize discourse in _includes
awvwgk Feb 14, 2021
d6c4203
Localize page description in code categories
awvwgk Feb 15, 2021
dce26ae
Add FAQ to translation file
awvwgk Feb 15, 2021
22097f3
Add language keys in the footer in the respective language itself
awvwgk Feb 15, 2021
3e0baef
Fix keyword for FAQ localization
awvwgk Feb 18, 2021
fa8c98d
French translation of the site: initial commit
vmagnin Feb 18, 2021
3177c5c
Add a Spanish version
aslozada Feb 15, 2021
33f63af
Update Spanish translation
aslozada Feb 18, 2021
d3f79c9
Symlink posts from English to French and Spanish subpage
awvwgk Feb 18, 2021
9397ec6
Localize News keyword at the main page
awvwgk Feb 18, 2021
796efaa
Localize package description correctly
awvwgk Feb 18, 2021
aa60168
Localize get involved header and package search placeholder
awvwgk Feb 19, 2021
8c58653
Fix templated link in news footer
awvwgk Feb 21, 2021
2a93a25
More detailed translating file
awvwgk Feb 21, 2021
b6c4ed8
Update compiler page by merging default branch
awvwgk Feb 21, 2021
1fb9900
Add resources collected in the Discourse thread
awvwgk Feb 21, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ source 'https://rubygems.org'
# This will help ensure the proper Jekyll version is running.
gem "jekyll", "~> 3.8.5"

# I18n support for Jekyll
gem "jekyll-multiple-languages-plugin"

# https://github.com/github/pages-gem
#gem 'github-pages', group: :jekyll_plugins
5 changes: 4 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ GEM
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-multiple-languages-plugin (1.7.0)
jekyll (>= 2.0, < 5.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-watch (2.2.1)
Expand Down Expand Up @@ -56,6 +58,7 @@ PLATFORMS

DEPENDENCIES
jekyll (~> 3.8.5)
jekyll-multiple-languages-plugin

BUNDLED WITH
2.1.4
2.2.5
36 changes: 36 additions & 0 deletions TRANSLATING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Translation and Internationalization
====================================


## Adding a new language.

Before starting to translate, make sure to setup *jeykll* as described in the
[README](./README.md).

To add a new language to the webpage add the language name to the *languages* array
in the [``_config.yml``](./_config.yml) file.
The first language in the arrays is the default language and is used in the main tree
at ``https://fortran-lang.org`` while additional trees are generated under
``https://fortran-lang.org/<lang>``.
You might have to restart *jekyll* to apply changes from the config file.


### Translating keywords

After adding a language to the config file, add its English name to the English subtree
at [``_i18n/en.yml``](./_i18n/en.yml) to the *langs* field.
To create a new tree from the added language copy the English language file

```
cp _i18n/en.yml _i18n/<lang>.yml
```

You can now start to fill the keyword translations in the new ``<lang>.yml`` file.


### Translating content

To translate the content of the main page ([``_i18n/en/index.html``](./i18n/en/index.html))
create a copy in the new language tree under ``_i18n/<lang>/index.html``.
Pages that do not have a translation will be used from the default language automatically,
therefore you can translate one page at a time.
2 changes: 2 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ markdown: kramdown

title: Fortran Programming Language
description: "Fortran Programming Language"
languages: ["en"]

news:
name: Fortran Newsletter
Expand All @@ -14,6 +15,7 @@ news:
url: "https://fortran-lang.org"

plugins:
- jekyll-multiple-languages-plugin

exclude:
- CNAME
Expand Down
73 changes: 73 additions & 0 deletions _i18n/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
global:
title: Fortran Programming Language
description: "Fortran Programming Language"
discourse: Discourse
twitter: Twitter
github: GitHub
rss_feed: RSS feed
mailing_list: Mailing List
toggle_nav: Toggle navigation
site_preview: Site preview
site_preview_info: you are previewing unpublished changes for
pull_request: pull request
join_discourse: >-
Join the discussion about all things Fortran on the
<a href="https://fortran-lang.discourse.group" target="_blank">fortran-lang discourse.</a>
hosted_on_github: >-
This site's source is <a href="https://github.com/fortran-lang/fortran-lang.org/">hosted on GitHub</a>.
subscribe_to_mailing_list: >-
Subscribe to our <a href="https://groups.io/g/fortran-lang" target="_blank">mailing list</a>
to discuss anything Fortran related, announce Fortran projects, discuss development
of core fortran-lang.org projects (stdlib, fpm), and get
the latest news.

nav:
- title: Learn
url: /learn/
- title: Compilers
url: /compilers/
- title: Community
url: /community/
- title: Packages
url: /packages/
- title: News
url: /news/

nav_key:
home: Home
learn: Learn
compilers: Compilers
community: Community
packages: Packages
news: News

book:
authors: Authors
introduction: Introduction
back_to_learn: Back to Learn Fortran index
important: Important
note: Note
tip: Tip

book_nav:
back: Back
next: Next

news:
authors: Authors
back_to_news: Back to news
more: More

packages:
featured: Featured Open Source Projects
tagline: A rich ecosystem of high-performance code
footer_text: >-
See
<a href="https://github.com/fortran-lang/fortran-lang.org/blob/master/PACKAGES.md" target="_blank">
<i class="devicon-github-plain colored"></i> here</a> for how to get your project listed.

langs:
en: English
fr: French
de: German

182 changes: 182 additions & 0 deletions _i18n/en/community/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
<section class="masthead">
<h1>{{ page.title }}</h1>
<h3>{{ page.description }}</h3>
</section>

<section class="front-section shaded">
<div class="container">
<h2>Fortran-lang Community Projects</h2>

<div class="col-narrow">

<h3><i data-feather="database"></i>
Fortran Standard Library (stdlib)</h3>
<p>
A community-driven project for a <i>de facto</i> "standard" library for Fortran.
The stdlib project is both a specification and a reference implementation, developed in
cooperation with the Fortran Standards Committee.
</p>
<span style="display: inline-block;">
<i class="fab fa-github"></i>
<a href="https://github.com/fortran-lang/stdlib" target="_blank" rel="noopener"><b>
GitHub </b></a>
&ensp;
</span>
<span style="display: inline-block;">
<i class="fas fa-info-circle"></i>
<a href="https://stdlib.fortran-lang.org/" target="_blank" rel="noopener"><b>
Documentation </b></a>
&ensp;
</span>
<span style="display: inline-block;">
<i class="fab fa-git-alt"></i>
<a href="https://github.com/fortran-lang/stdlib/blob/master/WORKFLOW.md" target="_blank" rel="noopener"><b>
Contributing </b></a>
</span>



<h3><i data-feather="package"></i>
Fortran Package Manager (fpm)</h3>
<p>
A prototype project to develop a common build system for Fortran packages
and their dependencies.
</p>
<span style="display: inline-block;">
<i class="fab fa-github"></i>
<a href="https://github.com/fortran-lang/fpm" target="_blank" rel="noopener"><b>
GitHub </b></a>
&ensp;
</span>
<span style="display: inline-block;">
<i class="fas fa-info-circle"></i>
<a href="https://github.com/fortran-lang/fpm/blob/master/PACKAGING.md" target="_blank" rel="noopener"><b>
Documentation </b></a>
&ensp;
</span>
<span style="display: inline-block;">
<i class="fab fa-git-alt"></i>
<a href="https://github.com/fortran-lang/fpm/blob/master/CONTRIBUTING.md" target="_blank" rel="noopener"><b>
Contributing </b></a>
</span>


<h3><i data-feather="globe"></i>
fortran-lang.org</h3>
<p>
This website is open source and contributions are welcome!
</p>
<span style="display: inline-block;">
<i class="fab fa-github"></i>
<a href="https://github.com/fortran-lang/fortran-lang.org" target="_blank" rel="noopener"><b>
GitHub </b></a>
&ensp;
</span>
<span style="display: inline-block;">
<i class="fab fa-git-alt"></i>
<a href="https://github.com/fortran-lang/fortran-lang.org/blob/master/CONTRIBUTING.md" target="_blank" rel="noopener"><b>
Contributing </b></a>
</span>

</br>

</div>

<div class="col-narrow">
<div id="fortran-lang-gh-feed" style="height: 500px;"></div>
</div>



</div>
</section>

<section class="front-section">
<div class="container">
<h2>Get Involved</h2>

<div class="col-narrow">
<h3>
<i data-feather="message-circle"></i>
Join the Discussion</h3>
<p>
The easiest way to join the community and contribute is by
commenting on issues and pull requests in the project
repositories.
<!-- Open discussion is vital to making project decisions,
and benefits greatly from varied expertise and insight across the community. -->
Whether Fortran beginner or seasoned veteran, your feedback and comments are most
welcome in guiding the future of Fortran-lang.


</p>
</div>

<div class="col-narrow">
<h3> <i data-feather="terminal"></i>
Build and Test</h3>
<p>
Get more involved with each project by cloning, building and testing
it on your own machine(s) and with your own codes;
if something doesn't work, create an issue to let us know!
We value user feedback highly, be it a bug report, feature request, or
suggestion for documentation.
</p>
</div>

</br>

<div class="col-narrow">
<h3> <i data-feather="edit"></i>
Contributor Guide</h3>
<p>
Want to contribute code and content?
Check out the contributor guides in each repository for information
on the project workflow and recommended practices.
</p>
<ul>
<li> <a href="https://github.com/fortran-lang/stdlib/blob/master/WORKFLOW.md" target="_blank" rel="noopener">Contributor guide for stdlib</a> </li>
<li> <a href="https://github.com/fortran-lang/fpm/blob/master/CONTRIBUTING.md" target="_blank" rel="noopener">Contributor guide for fpm</a> </li>
<li> <a href="https://github.com/fortran-lang/fortran-lang.org/blob/master/CONTRIBUTING.md" target="_blank" rel="noopener">Contributor guide for fortran-lang.org</a> </li>
</ul>
</div>

<div class="col-narrow">
<h3><i data-feather="smile"></i>
Community Conduct</h3>
<p>
As a community, we strive to make participation in our discussions and projects a friendly and
harassment-free experience for everyone.

</p>
<p> See the full
<a href="https://github.com/fortran-lang/stdlib/blob/master/CODE_OF_CONDUCT.md" target="_blank" rel="noopener">Code of Conduct</a>
</p>
</div>

</div>
</section>

<section class="front-section shaded">
<div class="container">
<h2>Fortran-lang Contributors</h2>
<p>
We are grateful for every contribution made by all members of the community.
</p>
<div id="gh-contributors-slider"></div>
<div id="gh-contributors"></div>
</div>
</section>


<script>

GitHubActivity.feed({
username: "fortran-lang",
selector: "#fortran-lang-gh-feed",
limit: 20 // optional
});

</script>


Loading