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

Finish the multilingual feature #2303

Closed
wants to merge 51 commits into from
Closed

Finish the multilingual feature #2303

wants to merge 51 commits into from

Conversation

bep
Copy link
Member

@bep bep commented Jul 26, 2016

This is currently slightly slower than master in a bench mark with 4 fairly big sites:

benchmark           old ns/op      new ns/op      delta
BenchmarkHugo-4     3146033049     3225819889     +2.54%

benchmark           old allocs     new allocs     delta
BenchmarkHugo-4     10557704       10850988       +2.78%

benchmark           old bytes      new bytes      delta
BenchmarkHugo-4     1628022920     1632976488     +0.30%

I guess this is mostly about doing "more work". I have done some general tuning in another PR (see #2378) after some profile work.

  • Add Translations and AllTranslations to Node.
  • Rework the site build process. Looping every site/language and doing the same for all of them kind of works, but isn't very effective nor elegant. Needs to extract the common tasks and do it once only.
  • Rework the documentation.
  • Fix all the TODO(bep) multilingo and TODO(bep) ml comments.
  • Check the relevant URL funcs, absURL etc.
  • Add more tests
  • Write redirect page to default lang on / when multilingual
  • Write a global sitemap.xml
  • Check that taxonomies can be configured on a per language basis
  • Add YAML config test
  • Check sitemap per language
  • Check list command etc.
  • Move shortcode handling to "pre render". The site isn't really ready at the current point where the shortcodes gets rendered, which comes as a surprise to many. This is even more true now with the multilanguage feature (Site.Pages etc. will be empty). So we need to move this handling to a later stage.
  • Watch: Handling adding and removing languages
  • Check Blackfriday config per site
  • Livereload inject
  • Check ref, relref
  • implement multilingual: Add option to keep the main language on top level #2312
  • Improve the default i18n vs missing bundles and translations
  • See https://github.com/spf13/hugo/pull/2303/files#diff-d7b04948857565053b55f353ccb2bab2R296 while this is a temporary workaround until we get a proper registry for "all nodes and pages", this may be confusing to users expecting the home object in the translations object to be a full blown home. Now even the title is kind of wrong when it is set per language. We should fix this if it isn't too hard. A temporary "node map" maybe.
  • check data in Page.Site.Data from shortcodes + add some data to the ML tests
  • fix variables docs section -- there are some old and not valid info there now
  • Double check all "reuse of nodes for RSS etc"
  • Double check the collection transfers
  • Check i18n template func in shortcode
  • Check shortcode changes vs livereload
  • Fix Go 1.7 vet issues

@bep bep added this to the v0.17 milestone Jul 26, 2016
@bep bep self-assigned this Jul 26, 2016
@doowonee
Copy link

doowonee commented Jul 27, 2016

I feel really pleasurable about this feature. If you don't mind I think taxonomy's should be multilingual too.

When see the taxonomy the url is fixed to domain/taxonomy but if url were domain/lang/taxonomy then it is more flexible I guess.

@bep
Copy link
Member Author

bep commented Jul 27, 2016

@the1900 I meant it when I said "no comments, please". I have a shitload of work to get the foundation up and running and I don't need "it would be nice if ...".

On a side note, I totally agree about the taxonomies.

@gohugoio gohugoio locked and limited conversation to collaborators Jul 27, 2016
@gohugoio gohugoio unlocked this conversation Jul 27, 2016
@bep bep force-pushed the multilingual branch 8 times, most recently from 2c29a90 to f7ef3de Compare August 1, 2016 10:54
@bep bep force-pushed the multilingual branch 10 times, most recently from 9a8bea2 to cba764b Compare August 4, 2016 20:34
@CLAassistant
Copy link

CLAassistant commented Aug 5, 2016

CLA assistant check
All committers have signed the CLA.

bep added 10 commits August 20, 2016 23:09
So the Permalink gets correct when listing translations.

I have also checked the other relevant places to make sure we do not overwrite node values we need later.

Pointers can be tricky, but lesson learned is: A copy is cheap.

Updates #2309
After a visual inspection to make (pretty) sure it is correct re multiple languages.

Updates #2309
We should get rid of these globals, but that is another month.
This commit also refines the partial rebuild logic, to make sure we do not do more work than needed.

Updates #2309
So we can do some benchmarking.
@gour
Copy link
Contributor

gour commented Aug 28, 2016

I've built 0.17multilingual and after reading the docs tried to run:

hugo --i18n-warnings | grep i18n i18n|MISSING_TRANSLATION|en|wordCount

but it reports about:

Error: unknown flag: --i18n-warnings

What do I miss?

@abourget
Copy link
Contributor

What's lugo?!

@abourget
Copy link
Contributor

Would it be useful that I review some more ? Are we good to go with this or does someone else need to take a look ?

I'll be happy to migrate my sites with any changes that were introduced here.. (since m17n) !

@gntech
Copy link
Contributor

gntech commented Aug 30, 2016

I think we are awaiting @spf to take a look at this and give the official go ahead

@bep
Copy link
Member Author

bep commented Aug 31, 2016

@yitzhakbg please use the forum for questions and marketing.

@yitzhakbg
Copy link

Pardon me. Thanks for the correction

Yitzhak Bar Geva https://www.linkedin.com/in/yitzhakbg

On 1 September 2016 at 00:56:27, Bjørn Erik Pedersen (
notifications@github.com) wrote:

@yitzhakbg https://github.com/yitzhakbg please use the forum for
questions and marketing.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#2303 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAA49IXiI55Cjn7ShuTZIoR3z7gOoUHMks5qlfh2gaJpZM4JVIOD
.

@bep
Copy link
Member Author

bep commented Sep 3, 2016

@spf13 has promised to take some time off his schedule to look at this PR. If he does not object to its content in the next few days, I will merge it.

@bep bep assigned bep and unassigned spf13 Sep 5, 2016
bep added a commit that referenced this pull request Sep 6, 2016
* Fall back to default language on missing translation file
* Add a i18n-warnings build flag
* If that flag is set, print a parseable and greppable string on missing translation strings

See #2303
@bep
Copy link
Member Author

bep commented Sep 6, 2016

Merged!

@bep bep closed this Sep 6, 2016
@bep bep deleted the multilingual branch December 10, 2016 20:57
tychoish pushed a commit to tychoish/hugo that referenced this pull request Aug 13, 2017
* Fall back to default language on missing translation file
* Add a i18n-warnings build flag
* If that flag is set, print a parseable and greppable string on missing translation strings

See gohugoio#2303
@shaform
Copy link

shaform commented Jul 11, 2018

If we have a global sitemap.xml, why don't we have a global robots.txt?

@github-actions
Copy link

github-actions bot commented Feb 4, 2022

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.