Michael added a comment.

  In T345083#9358631 <https://phabricator.wikimedia.org/T345083#9358631>, 
@Lucas_Werkmeister_WMDE wrote:
  
  > In T345083#9357025 <https://phabricator.wikimedia.org/T345083#9357025>, 
@Michael wrote:
  >
  >> Looking at Change name of mul language when used for terms (I7dbd94be) 
<https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/977258>, I 
wonder if it would not be better to have two new public methods on 
`LanguageNameLookup` like `getNameForTerms( string $languageCode )` and 
`getNameNotForTerms( string $languageCode )`. `getNameNotForTerms()` would then 
just directly call the now private `getName()` method and nothing else. 
`getNameForTerms()` would check if `$languageCode === 'mul'` and based on that 
either return a special name or also directly return the result of `getName()`.
  >>
  >> What do you think?
  >
  > Perhaps `getNameForTerms()` is nicer than `getName( $languageCode, 
LanguageNameLookup::FOR_TERMS )`, yeah. (It’s shorter, at least.) 
`getNameNotForTerms()` sounds strange, though. What if we just keep `getName()` 
public and add `getNameForTerms()` on top of it? This doesn’t force callers to 
choose between one or the other like the other approaches do (callers that use 
`getName()` can keep using it without even realizing the interface changed), 
but I think that’s okay (the meaning of `getName()` would be the same as 
before, and we already have Gerrit changes updating all the callers, so I don’t 
think we’re missing any).
  
  I was concerned that it might be confusing for someone who needs to make use 
of this in the future. But now I think it should be fine if we explain the 
purpose/usage instructions of `getName()` vs `getNameForTerms()` in their 
respective doc comments.

TASK DETAIL
  https://phabricator.wikimedia.org/T345083

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE, Michael
Cc: Michael, Lucas_Werkmeister_WMDE, Epidosis, Amire80, Mahir256, Nikki, 
Lydia_Pintscher, Sarai-WMDE, ItamarWMDE, Aklapper, Manuel, 
Danny_Benjafield_WMDE, Isabelladantes1983, Themindcoder, Adamm71, Jersione, 
Hellket777, LisafBia6531, Astuthiodit_1, 786, Biggs657, karapayneWMDE, 
Invadibot, maantietaja, Juan90264, Alter-paule, Beast1978, Un1tY, Akuckartz, 
Hook696, Kent7301, joker88john, CucyNoiD, Nandana, Gaboe420, Giuliamocci, 
Cpaulf30, Lahi, Gq86, Af420, Bsandipan, GoranSMilovanovic, QZanden, 
LawExplorer, Lewizho99, Maathavan, _jensen, rosalieper, Neuronton, Scott_WUaS, 
Wikidata-bugs, aude, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to