-
Notifications
You must be signed in to change notification settings - Fork 23
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
Added Internationalisation of Name #4
base: main
Are you sure you want to change the base?
Added Internationalisation of Name #4
Conversation
Caveat: The first_name, middle_name, and last_name variables in _config.yml are still required for checking whether or not a value for each category exists (checking with the localized variants doesn't work for me for some reason). This means that you would have to have a first/middle/last name in each localized language if (and only if) you have one set in __config.yml (otherwise a superfluous non-breaking character is added in the header). Otherwise, the implementation works fine for me (displayed text and metadata). |
Signed-off-by: DavidKrassnig <[email protected]>
b2c0602
to
892ad02
Compare
Good point, in some languages the names might be used in a different order/different charset. Do you think maybe a solution like I implemented in date_format fits better? |
Hm. Yes, I hadn't really considered the issue of different order (my required case followed the same order). That would require an edit along the lines of your date_format, as you suggested. Perhaps an if-clause that switches the display of Aside from that, I would think that the rest can be kept as is (at least in its basic form). Or at least I wouldn't immediately see the advantage of putting the localisation variable elsewhere. Perhaps adding an if-clause that reverts to the What do you think? |
I believe you can fix this by looking for the key in the language file. This can be done like this: Regarding the order, thinking about it now, maybe it is a good idea to create a new file to handle the order or any other language specific detail that a user might want to handle. This can be useful since the name appears in some places, like |
Your recommendation worked perfectly, thanks! I also fixed a bug that occurred when the main language missed a name variable. It should work perfectly without the entries in |
143b887
to
ba187d6
Compare
Right, I incorporated your feedback. Be aware that this introduces a minor issue: If a person has no first name, there's going to be an empty space character in front of the middle/last name in the metadata (the only way to avoid that, as far as I can tell with my meagre liquid skills, is to do the split+join I originally did or by adding a whole lot of if-conditions). |
I am also not a prolific Jekyll dev, but I know there is a different solution to this. As I once saw posted here, simply using This is not that simple though, since I tried a dumb replace all in the code once, and it stopped showing things correctly. Also note that it is possible to remove the extra spaces in only one direction, by using Another suggestion for when the name is used in more than one place in the file, like the footer, I think it is better if you use your previous |
Added the functionality to change the author's name for each language. Helpful for those who want to add localization for languages that do not use the Latin alphabet (e.g. Chinese or Hebrew) or that have grammatical rules that alter name representation (e.g. Esperanto).