adrianheine added a subscriber: JeroenDeDauw.
adrianheine added a comment.

I'm wondering how to best implement this. One goal would be to not duplicate 
ext.uls.languagenames (which currently has 3.8kb gzipped / 7.3kb uncompressed 
for en). I'd also like to have something quite flexible: It should support at 
least `ULS`, `ULS + static language list`, `ULS - static language list`, 
`static language list` as values. I think this issue mirrors the question of 
how to configure content languages. I suggest to take a similar approach for 
both problems, if not exactly the same.

What I'm currently thinking about is basically giving a class hierarchy as 
config and serialization:

  $monolingualTextValueLanguages = FilteringContentLanguages::spec(
    MergingContentLanguages::spec(
      UlsContentLanguages::spec(),
      ListContentLanguages::spec( array( 'zxx', 'und' ) )
    ),
    ListContentLanguages::spec( array( 'en', 'fr', 'de' ) )
  ); /* => array(
    'type' => 'Filtering',
    '_left' => array(
      'type' => 'Merging',
      '_left' => array( 'type' => 'Uls' ),
      '_right' => array( 'type' => 'List', '_list' => array( 'zxx', 'und' ) )
     ),
     '_right' => array( 'type' => 'List', '_list' => array( 'en', 'fr', 'de' ) )
  ) */
  
  mw.config.set( 'wbMonolingualTextValueLanguages', {
    type: 'Filtering',
    _left: {
      type: 'Merging',
      _left: { type: 'Uls' },
      _right: { type: 'List', _list: [ 'zxx', 'und' ] }
     },
    _right: { type: 'List', _list: [ 'en', 'fr', 'de' ] }
  }
  } );

@jeroendedauw @daniel @thiemowmde What do you think?


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

REPLY HANDLER ACTIONS
  Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign 
<username>.

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

To: adrianheine
Cc: JeroenDeDauw, Wikidata-bugs, jeblad, thiemowmde, JanZerebecki, adrianheine, 
Aklapper, Lydia_Pintscher, daniel, Jdouglas, aude



_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to