Comments (9)
I assume this is due to the use of mkdocs-static-i18n
in combination with this plugin?
from mkdocs-git-revision-date-localized-plugin.
Hi @jrappen 👋🏻 ,
I assume you're using the mkdocs-material
theme, which has a native integration for this plugin. That means you didn't have to bother with making a theme override (see the docs how to/customize a theme for details).
If you look at https://github.com/squidfunk/mkdocs-material/blob/master/src/partials/source-file.html you should notice these two lines:
{{ lang.t("source.file.date.updated") }}:
{{ page.meta.git_revision_date_localized }}
That means the label "Letzes Update" is provided by mkdocs-material
, and depends on the language you set in your theme (see changing the language).
You now have two options:
- Either customize the theme, and write whatever you'd like.
- Update the translations from
mkdocs-material
by updating these two lines and providing a better German translation.
1)
is a quick fix and 2)
is a long term solution I think the community would appreciate the most ;)
from mkdocs-git-revision-date-localized-plugin.
@timvink My question was rather, why the first part was translated but not the second.
from mkdocs-git-revision-date-localized-plugin.
Not sure I understand your question then. These are the translations you show:
They come from this translation file:
"source.file.date.updated": "Letztes Update",
"source.file.date.created": "Erstellt",
I don't speak German. I have contributed those lines to mkdocs-material
by using google translate (see squidfunk/mkdocs-material@cee1eb4).
If you have better translation, either if you make a PR to mkdocs-material
yourself, or let me know what the translation is and I'll do it :)
from mkdocs-git-revision-date-localized-plugin.
@timvink Anything after the colon, as "2 months ago" in this case, isn't translated. It remains in English.
from mkdocs-git-revision-date-localized-plugin.
Ohhh I see, I thought the second part was the Erstellt: 2 month ago
that was not translated properly.
I looked at your website, and changing language: en
to language: de
here should solve it:
https://github.com/jrappen/recipes/blob/c67e90f1500fad82e2a7d6c55b053c9278f103f2/mkdocs.yml#L18
I think the core issue is that this plugin does not support the mkdocs-static-i18n
plugin, more specifically, there's no support for defining the lang: de
in the YAML frontmatter as you do f.e. here: https://raw.githubusercontent.com/jrappen/recipes/main/docs/src/markdown/cookies.de.md
That should be there. I'll look into it next time I work on the plugin, probably somewhere next weekend.
from mkdocs-git-revision-date-localized-plugin.
@timvink Changing from theme: language:en
to theme: language: de
will only fix it for German pages, but probably break it for English pages as a result. I assume this is because @squidfunk 's mkdocs-material
theme only accepts a "global" language setting for the whole site.
from mkdocs-git-revision-date-localized-plugin.
Yes, this plugin also only supports a global language setting. I will build in support for per-page language setting.
from mkdocs-git-revision-date-localized-plugin.
I implemented support for the i18n
plugin in #83 and just released it in v1.0.0. This should fix your partial translation issue also.
from mkdocs-git-revision-date-localized-plugin.
Related Issues (20)
- ``InvalidGitRepositoryError`` during build when including auto-generated files HOT 8
- Unable to set any configurations HOT 12
- Typo in variable names HOT 2
- The plugin breaks with the last mkdocs docker image HOT 3
- The plugin breaks with squidfunk/mkdocs-material:9.0.3 HOT 1
- Is there a way to turn off warnings? HOT 4
- Improve error message for dubious git ownership HOT 2
- if a file has no git logs, use the last modified timestamp instead of the current HOT 4
- which themes will this plugin work?
- Feature request: exclude specific commits when calculating the 'last update' calculation HOT 3
- Poor performance on large monorepos HOT 3
- Timeago setting results in incorrect items being added to extra_javascript HOT 2
- Create date not correct on Github pages HOT 4
- Document how to use sparse checkouts
- correctly populate `lastmod` of `sitemap.xml` HOT 2
- DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version HOT 1
- Cloudflare Pages fetch-depth HOT 6
- 1.2.3 breaks integration with Material for MkDocs HOT 5
- Whitelist / Negate certain excludes with a `!`? HOT 1
- Feature Request: Show datetime on hover when using timeago
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mkdocs-git-revision-date-localized-plugin.