Skip to content

Conversation

@monkeyiq
Copy link
Contributor

Changing this line allows Portuguese (Brazil) to be selectable from the language menu again in 2.3.

Note that setLanguageCookie() and getLanguageCookie() also contain forced lower casing which is worth investigating too in order to make sure things do not fall through the cracks there.

@codecov
Copy link

codecov bot commented Aug 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.93%. Comparing base (64d0973) to head (674a913).

Additional details and impacted files
@@                   Coverage Diff                   @@
##             simplesamlphp-2.3    #2216      +/-   ##
=======================================================
- Coverage                44.94%   44.93%   -0.01%     
  Complexity                3893     3893              
=======================================================
  Files                      162      162              
  Lines                    12975    12974       -1     
=======================================================
- Hits                      5831     5830       -1     
  Misses                    7144     7144              

@tvdijen
Copy link
Member

tvdijen commented Aug 26, 2024

Thanks @monkeyiq for diving into this.. I think in this case we could just remove the strotolower-line..

@monkeyiq
Copy link
Contributor Author

That CI test that is failing is checking if language.parameter.name value is transformed to lower case. So if folks were using things like 'Es' to select a language then that will no longer work.

@tvdijen
Copy link
Member

tvdijen commented Aug 26, 2024

I guess that's OK.. I really doubt people are adding values to the list, they only remove what is not needed.

@tvdijen
Copy link
Member

tvdijen commented Aug 26, 2024

I wonder if the Brazilian translations ever worked, because it is now just using pt..
It's being reduced from pt_BR to to in Localization::getLangPath..

@monkeyiq
Copy link
Contributor Author

I see what you mean in getLangPath with the explode('_', $this->langcode);. I suspect in this case it is still working because going from pt_BR to pt still gives Portuguese.

I think in this case we might want to rename the pt-br directory to pt_BR and try that full path first before falling back to the first two chars only. IIRC there are locale choices where the language is the same but the customs of the locale might want a different translation or other arangement.

@monkeyiq monkeyiq merged commit b9e38b9 into simplesamlphp:simplesamlphp-2.3 Aug 27, 2024
monkeyiq added a commit that referenced this pull request Aug 27, 2024
* i18n in 2.3 allow Brazilian to be selected again

* This is a more special case

* break the CI again but with simpler code

* Allow CI to complete with no implicit lower case on lang

* One more case of strtolower

---------

Co-authored-by: Tim van Dijen <tvdijen@gmail.com>
@tvdijen
Copy link
Member

tvdijen commented Aug 27, 2024

Yeah, I did that (renaming pt-br directory to pt_BR and test that one before falling back to pt) and that gave me completely different translations.. I'll create yet another PR to fix this too, and remain backwards compatible.

Can you see if you can restore BC on the admin-password issue? Maybe I can release 2.3.1 by the end of this week then

@tvdijen
Copy link
Member

tvdijen commented Aug 27, 2024

This should not have been merged with broken tests by the way.. Fixed in b46c8da

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants