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

Disabling languages produces unexpected results in 0.123.0-DEV #11958

Closed
TiGR opened this issue Feb 1, 2024 · 8 comments · Fixed by #11969
Closed

Disabling languages produces unexpected results in 0.123.0-DEV #11958

TiGR opened this issue Feb 1, 2024 · 8 comments · Fixed by #11969
Assignees
Milestone

Comments

@TiGR
Copy link

TiGR commented Feb 1, 2024

We have multi-language website. During development we use another environment, that disables most of languages and also ignores some content directories for faster builds. The development environment config has a disableLanguages directive with multiple languages listed. There are 2 weird things happening:

First, translation pages of disabled languages seems to be processed as regular pages, as we start getting duplicate menu entry with identifier "home" in menu "main" warnings from _index.xx.md files, where xx are disabled languages. Building entire website has no this issue, neither there is such a problem in latest stable release.

Second, the stats are way off for the default language:

                   |  EN   |  ZH
-------------------+-------+-------
  Pages            | 84535 | 2822  
  Paginator pages  |    63 |   62  
  Non-page files   |  1349 | 1205  
  Static files     |   118 |  118  
  Processed images | 36097 |  889  
  Aliases          |  1397 |  288  
  Cleaned          |     0 |    0 

Compare it with 0.122.0 on the same files:

                   |  EN   |  ZH   
-------------------+-------+-------
  Pages            |  3602 | 2979  
  Paginator pages  |    77 |   77  
  Non-page files   |  1338 | 1338  
  Static files     |   118 |  118  
  Processed images | 13023 |   18  
  Aliases          |   290 |  288  
  Sitemaps         |     2 |    1  
  Cleaned          |     0 |    0 

Notice Pages and Processed images stats for EN language are way off.

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.123.0-DEV+extended linux/amd64 BuildDate=unknown

Does this issue reproduce with the latest release?

No, everything works fine

@bep
Copy link
Member

bep commented Feb 1, 2024

Second, the stats are way off for the default language:

But I guess the numbers adds up if you consider the disabled languages.

I'm guessing that we now (wrongly) detect "disabled French" (as an example) content as "default language". Which is a little odd that we don't have a test for.

But thanks for the report.

@TiGR
Copy link
Author

TiGR commented Feb 1, 2024

Well, the numbers won't add up as per the environment. It looks like ignoreFiles is also ignored, as 84 thousand pages is the total number of all pages across all languages and all files. And also, we get that menu item duplication warning (which is not a duplication). If we consider only the not ignored files and all languages, we should get something like 33 thousand pages.

@TiGR
Copy link
Author

TiGR commented Feb 1, 2024

Actually, I've built the website and the stats are as follows:

                   |   EN   |  ES  |  DE  |  RU  |  FR  |  IT  |  FI  |  PT  |  JA  |  KO  |  ZH   
-------------------+--------+------+------+------+------+------+------+------+------+------+-------
  Pages            |   6447 | 5821 | 5819 | 5819 | 5819 | 5819 | 5819 | 5819 | 5819 | 5819 | 5819  
  Paginator pages  |    481 |  480 |  480 |  480 |  480 |  480 |  480 |  480 |  480 |  480 |  480  
  Non-page files   |   2614 | 2467 | 2465 | 2465 | 2465 | 2465 | 2465 | 2465 | 2465 | 2465 | 2465  
  Static files     |    118 |  118 |  118 |  118 |  118 |  118 |  118 |  118 |  118 |  118 |  118  
  Processed images | 350748 |  102 |    3 |    3 |    3 |    3 |  452 |  655 |  669 |  595 |  656  
  Aliases          |    905 |  900 |  900 |  900 |  900 |  900 |  900 |  900 |  900 |  900 |  900  
  Cleaned          |      0 |    0 |    0 |    0 |    0 |    0 |    0 |    0 |    0 |    0 |    0  

It is 64 thousand pages, and processed images a way off. Building with 0.122 shows 21 thousand images and 1 image per translation (as we don't load images from translated page resource, as I've said in another issue). Also, it is weird that it is such a great difference in number of images in languages after FI (hundreds vs 3)

@bep
Copy link
Member

bep commented Feb 1, 2024

Again, I'm not able to reproduce this in my tests/test sites.

I'm not saying that this isn't an issue/bug, but it does suggest that there is something "special" about your setup. Again, if you could produce a simpler and running setup that demonstrates the above, that would be appreciated.

@TiGR
Copy link
Author

TiGR commented Feb 1, 2024

So, I've got the website with reproduction code here. Running it in default environment works well. Running with -etest (in test environment) produces duplication warning.

@bep
Copy link
Member

bep commented Feb 1, 2024

Thanks; yea, I see it now. My tests for this were not ... great. I will fix this tomorrow. Thanks for the demo.

@bep
Copy link
Member

bep commented Feb 1, 2024

This should be fixed in 4174a78

Copy link

This issue 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 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants