Coder Social home page Coder Social logo

Comments (9)

jrappen avatar jrappen commented on May 24, 2024

I assume this is due to the use of mkdocs-static-i18n in combination with this plugin?

from mkdocs-git-revision-date-localized-plugin.

timvink avatar timvink commented on May 24, 2024

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:

  1. Either customize the theme, and write whatever you'd like.
  2. 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.

jrappen avatar jrappen commented on May 24, 2024

@timvink My question was rather, why the first part was translated but not the second.

from mkdocs-git-revision-date-localized-plugin.

timvink avatar timvink commented on May 24, 2024

Not sure I understand your question then. These are the translations you show:

image

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.

jrappen avatar jrappen commented on May 24, 2024

@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.

timvink avatar timvink commented on May 24, 2024

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.

jrappen avatar jrappen commented on May 24, 2024

@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.

timvink avatar timvink commented on May 24, 2024

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.

timvink avatar timvink commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.