Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/122293
Change subject: Migrate to JSON i18n ...................................................................... Migrate to JSON i18n Procedure per https://www.mediawiki.org/wiki/Manual:GenerateJsonI18n.php with shim. Change-Id: Ic2988d5b39691843258c0d744fda17d1f6c418c3 --- M CommunityHiring.i18n.php M CommunityHiring.php A i18n/en.json 3 files changed, 65 insertions(+), 35 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommunityHiring refs/changes/93/122293/1 diff --git a/CommunityHiring.i18n.php b/CommunityHiring.i18n.php index cc80283..eeb2776 100644 --- a/CommunityHiring.i18n.php +++ b/CommunityHiring.i18n.php @@ -1,38 +1,31 @@ <?php +/** + * This is a backwards-compatibility shim, generated by: + * https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php + * + * Beginning with MediaWiki 1.23, translation strings are stored in json files, + * and the EXTENSION.i18n.php file only exists to provide compatibility with + * older releases of MediaWiki. For more information about this migration, see: + * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format + * + * This shim maintains compatibility back to MediaWiki 1.17. + */ $messages = array(); +$GLOBALS['wgHooks']['LocalisationCacheRecache'][] = function ( $cache, $code, &$cachedData ) { + $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); + foreach ( $codeSequence as $csCode ) { + $fileName = __DIR__ . "/i18n/$csCode.json"; + if ( is_readable( $fileName ) ) { + $data = FormatJson::decode( file_get_contents( $fileName ), true ); + foreach ( array_keys( $data ) as $key ) { + if ( $key === '' || $key[0] === '@' ) { + unset( $data[$key] ); + } + } + $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); + } -$messages['en'] = array( - 'communityhiring-header' => 'Job Openings/Community Department', - 'communityhiring-aboutyou' => 'Tell us about yourself', - 'communityhiring-about-intro' => 'Please tell us about yourself and your interest in a position at Wikimedia Foundation.', - 'communityhiring-given' => 'Given Name:', - 'communityhiring-family' => 'Family Name:', - 'communityhiring-address' => 'Address: (Optional)', - 'communityhiring-address-city' => 'City:', - 'communityhiring-address-postal' => 'Postal Code: (Optional)', - 'communityhiring-address-country' => 'Country:', - 'communityhiring-phone' => 'Phone: (Optional)', - 'communityhiring-email' => 'Email address:', - 'communityhiring-paragraphs' => 'Wikimedia', - 'communityhiring-paragraphs-intro' => 'Please answer the next questions with a single, well thought out paragraph.', - 'communityhiring-significance' => 'Tell us how you see the significance of Wikimedia communities in the world.', - 'communityhiring-excitement' => 'Tell us what you find personally exciting about Wikipedia or any other Wikimedia community.', - 'communityhiring-experiences' => 'Describe the experiences and/or training that qualify you to serve the Wikimedia communities in a staff position at Wikimedia Foundation.', - 'communityhiring-other' => "Is there anything else you'd like to tell us about yourself? (Optional)", - 'communityhiring-demonstrative' => '', - 'communityhiring-involvement' => 'Community Involvement', - 'communityhiring-contributor' => 'Are you a contributor to any Wikimedia Project?', - 'communityhiring-usernames' => 'Feel free to tell us your usernames on the projects you work on: (Optional)', - 'communityhiring-links' => "Give us up to three links to work in the Wikimedia communities that you're proud of: (Optional)", - 'communityhiring-languages' => 'Language proficiency', - 'communityhiring-languages-label' => 'What languages can you speak and write proficiently?', - 'communityhiring-links-other' => "Give us up to three URLs of work outside of Wikimedia communities that you're proud of. This may include your professional resume. (Optional)", - 'communityhiring-availability' => 'Availability', - 'communityhiring-availability-intro' => "Tell us if there is a particular time when you'd be available to come work at Wikimedia Foundation:", - 'communityhiring-availability-info' => "Anything else we should know about when you'd be available: (Optional)", - 'communityhiring-relocation-ok' => 'Are you willing to relocate to San Francisco, California?', - 'communityhiring-research' => "In one or two sentences, describe the process in which users are approved to become administrators on English Wikipedia. - - (You are not expected to know the answer to this question already. You can find the answer [[w:Wikipedia:RFA|here]] but feel free to consult other resources. We're not looking for a detailed description of the process, but a sentence that captures the essence of the process and how it works.)", - 'communityhiring-field-required' => 'This field is required', -); + $cachedData['deps'][] = new FileDependency( $fileName ); + } + return true; +}; diff --git a/CommunityHiring.php b/CommunityHiring.php index eca65ee..902be5f 100644 --- a/CommunityHiring.php +++ b/CommunityHiring.php @@ -11,6 +11,7 @@ $wgSpecialPages['CommunityHiring'] = 'SpecialCommunityHiring'; $wgAutoloadClasses['SpecialCommunityHiring'] = dirname(__FILE__) . "/SpecialCommunityHiring.php"; +$wgMessagesDirs['CommunityHiring'] = __DIR__ . '/i18n'; $wgExtensionMessagesFiles['CommunityHiring'] = dirname( __FILE__ ) . "/CommunityHiring.i18n.php"; $wgCommunityHiringDatabase = false; diff --git a/i18n/en.json b/i18n/en.json new file mode 100644 index 0000000..d73c9c5 --- /dev/null +++ b/i18n/en.json @@ -0,0 +1,36 @@ +{ + "@metadata": { + "authors": [] + }, + "communityhiring-header": "Job Openings/Community Department", + "communityhiring-aboutyou": "Tell us about yourself", + "communityhiring-about-intro": "Please tell us about yourself and your interest in a position at Wikimedia Foundation.", + "communityhiring-given": "Given Name:", + "communityhiring-family": "Family Name:", + "communityhiring-address": "Address: (Optional)", + "communityhiring-address-city": "City:", + "communityhiring-address-postal": "Postal Code: (Optional)", + "communityhiring-address-country": "Country:", + "communityhiring-phone": "Phone: (Optional)", + "communityhiring-email": "Email address:", + "communityhiring-paragraphs": "Wikimedia", + "communityhiring-paragraphs-intro": "Please answer the next questions with a single, well thought out paragraph.", + "communityhiring-significance": "Tell us how you see the significance of Wikimedia communities in the world.", + "communityhiring-excitement": "Tell us what you find personally exciting about Wikipedia or any other Wikimedia community.", + "communityhiring-experiences": "Describe the experiences and/or training that qualify you to serve the Wikimedia communities in a staff position at Wikimedia Foundation.", + "communityhiring-other": "Is there anything else you'd like to tell us about yourself? (Optional)", + "communityhiring-demonstrative": "", + "communityhiring-involvement": "Community Involvement", + "communityhiring-contributor": "Are you a contributor to any Wikimedia Project?", + "communityhiring-usernames": "Feel free to tell us your usernames on the projects you work on: (Optional)", + "communityhiring-links": "Give us up to three links to work in the Wikimedia communities that you're proud of: (Optional)", + "communityhiring-languages": "Language proficiency", + "communityhiring-languages-label": "What languages can you speak and write proficiently?", + "communityhiring-links-other": "Give us up to three URLs of work outside of Wikimedia communities that you're proud of. This may include your professional resume. (Optional)", + "communityhiring-availability": "Availability", + "communityhiring-availability-intro": "Tell us if there is a particular time when you'd be available to come work at Wikimedia Foundation:", + "communityhiring-availability-info": "Anything else we should know about when you'd be available: (Optional)", + "communityhiring-relocation-ok": "Are you willing to relocate to San Francisco, California?", + "communityhiring-research": "In one or two sentences, describe the process in which users are approved to become administrators on English Wikipedia. \n\n\t(You are not expected to know the answer to this question already. You can find the answer [[w:Wikipedia:RFA|here]] but feel free to consult other resources. We're not looking for a detailed description of the process, but a sentence that captures the essence of the process and how it works.)", + "communityhiring-field-required": "This field is required" +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/122293 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic2988d5b39691843258c0d744fda17d1f6c418c3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CommunityHiring Gerrit-Branch: master Gerrit-Owner: Siebrand <siebr...@kitano.nl> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits