Giter VIP home page Giter VIP logo

Comments (13)

adityatelange avatar adityatelange commented on May 31, 2024

@Northerner-coder Take a look at #48.
Actually I had this thing in my mind but never pushed it as no one requested :p

The i18n idea is more of a time consuming process, I think if user wants his/hers website localized best way is add the months yourself for language needed
The linked PR does that.

Also can you test the code out for your native language and let me know if it goes well.

Thank You.
~ Aditya

from hugo-papermod.

Northerner-coder avatar Northerner-coder commented on May 31, 2024

@adityatelange Thank you! Checked the #48 - works like a charm.

Main advantage of i18n before this solution: it will work out-of-the-box if filled in the localization file, user needs only to choose the language. Additionally, all localization stays in one place, leaving config with more settings and less content directives.

Do you mind if I test i18n option out to see whether and how it works in practice? After that you can decide which option to use.

from hugo-papermod.

adityatelange avatar adityatelange commented on May 31, 2024

@Northerner-coder even if we add i18n we cannot support each and every language.
Translations can be tough, words mean different than the actual action that the keyword button does.
After this I am even thinking to rule of i18n and let the user choose the keywords they want. What do you think ?

Hugo's Internationalisation never worked out of the box, there are few things yet to be implemented.

from hugo-papermod.

Northerner-coder avatar Northerner-coder commented on May 31, 2024

After this I am even thinking to rule of i18n and let the user choose the keywords they want. What do you think ?

Sorry, didn't get the part about choosing the 'let the user choose the keywords'.

from hugo-papermod.

adityatelange avatar adityatelange commented on May 31, 2024

After this I am even thinking to rule of i18n and let the user choose the keywords they want. What do you think ?

Sorry, didn't get the part about choosing the 'let the user choose the keywords'.

I mean let the user choose the translations for words on the buttons if they aren't listed

from hugo-papermod.

adityatelange avatar adityatelange commented on May 31, 2024

Also I am rethinking about PR #48,
This will only add month translations to archive page,

We can add to other elements too but hugo supports multiple formats for date
This format can be applied only to a few( not Mon Jan 2 2006 , not Mon, 02 Jan 2006 15:04:05 -0700, moreover the days, will remain as it is.

from hugo-papermod.

Northerner-coder avatar Northerner-coder commented on May 31, 2024

After this I am even thinking to rule of i18n and let the user choose the keywords they want. What do you think ?

Sorry, didn't get the part about choosing the 'let the user choose the keywords'.

I mean let the user choose the translations for words on the buttons if they aren't listed

I guess it means adding i18n for all interface text. As far as I understand this is a standard way for multi-language support.

from hugo-papermod.

Northerner-coder avatar Northerner-coder commented on May 31, 2024

Also I am rethinking about PR #48,

This will only add month translations to archive page,

We can add to other elements too but hugo supports multiple formats for date

This format can be applied only to a few( not Mon Jan 2 2006 , not Mon, 02 Jan 2006 15:04:05 -0700, moreover the days, will remain as it is.

The issue with localized date is a Go problem in general. There are packages that allow to sort it out. I do not think that it is feasible to use them in Hugo theme context.

Yes, months translation will be limited to archives and any other cases where month should be written in full (none at the moment).

As to dares in general, I proposed date format exactly to avoid commotion with the dates localization. For instance in Russia it is customary to use date format 18.10.2020. Using digits only I am not concerned with the localization. This is a half measure, but an effective one.

from hugo-papermod.

adityatelange avatar adityatelange commented on May 31, 2024

I guess it means adding i18n for all interface text. As far as I understand this is a standard way for multi-language support.

Yes it is a standard way but the problem is we cannot translate over languages people use, so it might be better to give them a choice to add their own translations for themselves without touching the i18n directory, but from config.yml itself,

As we can have multople config file user could add a config.tranlate.yml so that preferred translations could be used

from hugo-papermod.

Northerner-coder avatar Northerner-coder commented on May 31, 2024

@adityatelange tried alternative implementation for months translation via i18n #50 - for better comparison.

Sure, translations can be done in config as well. However i18n provides additional functionality for translations, for instance including integer inside of a translation string and multiple options depending on the integer (one, many, etc.). I am not sure that it is easy to implement via config.

from hugo-papermod.

stale avatar stale commented on May 31, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from hugo-papermod.

zzmark avatar zzmark commented on May 31, 2024

consider to using js: moment or dayjs ?

defect:

  • not static
  • need some language pack

from hugo-papermod.

adityatelange avatar adityatelange commented on May 31, 2024

consider to using js: moment or dayjs ?

defect:

  • not static
  • need some language pack

Yes, it hinders performance.

from hugo-papermod.

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.