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

Force language options to Gitalk comment system #653

Merged
merged 1 commit into from
Mar 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -617,11 +617,15 @@ gitment:
gitalk:
enable: false
github_id: # Github repo owner
repo: # Repository name to store issues.
repo: # Repository name to store issues
client_id: # Github Application Client ID
client_secret: # Github Application Client Secret
admin_user: # GitHub repo owner and collaborators, only these guys can initialize github issues
distraction_free_mode: true # Facebook-like distraction free mode
# Gitalk's display language depends on user's browser or system environment
# If you want everyone visiting your site to see a uniform language, you can set a force language value
# Available value: en, es-ES, fr, ru, zh-CN, zh-TW
language:

# Baidu Share
# Available values: button | slide
Expand Down
5 changes: 5 additions & 0 deletions layout/_third-party/comments/gitalk.swig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
owner: '{{ theme.gitalk.github_id }}',
admin: ['{{ theme.gitalk.admin_user }}'],
id: md5(location.pathname),
{% if theme.gitalk.language == '' %}
language: window.navigator.language || window.navigator.userLanguage,
{% else %}
language: '{{ theme.gitalk.language }}',
{% endif %}
distractionFreeMode: '{{ theme.gitalk.distraction_free_mode }}'
});
gitalk.render('gitalk-container');
Expand Down