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

[Proposal] Show list of available translations #27

Merged
merged 2 commits into from
Apr 4, 2018
Merged

[Proposal] Show list of available translations #27

merged 2 commits into from
Apr 4, 2018

Conversation

Zebradil
Copy link
Collaborator

@Zebradil Zebradil commented Apr 3, 2018

Hi!

I have an idea to show list of available translations somewhere. Currently I placed the list right under post title. It displays if there is at least one translation for the post. In example below I created post in three languages: English, Spanish and Russian.

For English version:
screen shot 2018-04-03 at 23 51 23

For Russian version:
screen shot 2018-04-03 at 23 52 39

What do you think?

@@ -6,6 +6,9 @@
<h1 class="post-title">{{ .Title }}</h1>

<div class="post-meta">
<div class="post-meta">
Copy link
Owner

@xianmin xianmin Apr 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, it's better to palce an {{ if .IsTranslated }} {{ end }} between these code.

Or, only modify the i18nlist.html , like this:

{{ if .IsTranslated }}  
<div class="post-meta">
  ......
</div>
{{ end }}

What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I took the code from the Hugo docs and initially there was this condition {{ if .IsTranslated }} . But in this case I don't see translations in post version written in default language. That's why I removed it.

That's strange — now it is working with this condition. I'll update the PR.

@xianmin
Copy link
Owner

xianmin commented Apr 4, 2018

This proposal is fantastic! 😄
I commented on a small piece of code.

@Zebradil
Copy link
Collaborator Author

Zebradil commented Apr 4, 2018

I'm not sure how to do it nice in meaning of design. Maybe it's a good idea to underline links as it's done with post title? I also thought about adding flags to emphasize these links (🇬🇧🇷🇺🇪🇸🇨🇳).

@xianmin
Copy link
Owner

xianmin commented Apr 4, 2018

Thanks for your Pull Requests! Maybe this is enough for now.
I'm not sure how many people will need this feature.
If they have better proposal, we can improve. 😄

@xianmin xianmin merged commit 6dd367f into xianmin:master Apr 4, 2018
@Zebradil Zebradil deleted the feature/better-internationalisation branch April 4, 2018 12:24
@Zebradil
Copy link
Collaborator Author

Zebradil commented Apr 4, 2018

Great, thanks!

xianmin added a commit that referenced this pull request Apr 4, 2018
If you have any good idea, welcome to report issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants