Contenu supprimé Contenu ajouté
Bawolff (discuter | contributions)
→‎WN:AP : updates
Bawolff (discuter | contributions)
→‎WN:AP : img map+ bug you found fixed
Ligne 201 :
I discovered some futher issues involving accents. Basically, it tries to use the builtin <code>\w</code> character class to try to find word-characters. however \w only includes ascii letters (Which is stupid imho). Anyways, please re-copy [[MediaWiki talk:Common.js/Wikinews:Article principal/leadGenerator]] to [[MediaWiki:Common.js/Wikinews:Article principal/leadGenerator]]. cheers. [[Utilisateur:Bawolff|Bawolff]] 25 novembre 2009 à 03:14 (UTC)
:Also, I just recently made some improvements to the version on en wikinews, where if the article has no image, it will geuss what image used based on either templates or categories present in the article. Do you want me to port these changes over here too? [[Utilisateur:Bawolff|Bawolff]] 30 novembre 2009 à 13:57 (UTC)
::Ok. The issue you noticed (both of them actually) had to do with the script not recognizing the french word for the image/file namespace (Ficher). That should be fixed on the talk page of that script. I also added the category map code. It is a list of images to fall back to if it can't find one in the article. I copied the version from en - it needs to be translated to your local category/template names. Its the following part (near the top of the script):
 
Bawolff.leadGen.imgMap = { "UK" : "Flag of the United Kingdon.svg",
"United Kingdom": "Flag of the United Kingdom.svg",
"United States": "Flag of the United States.svg",
"Canada": "Flag of Canada.svg",
"Mexico": "Flag of Mexico.svg",
"Computing": "Computer-aj aj ashton 01.svg",
"Google": "Google logo png.png",
"Obituary": "Wikinews tag obituary.png",
"Science and technology infobox": "Science-symbol-2.svg",
"Science and technology": "Science-symbol-2.svg" }
 
Each line reads as follows: <code> "category or template name": "Image without leading namespace to use if category/template present",</code>
For example, the first line <code>"UK" : "Flag of the United Kingdom.svg"</code> will cause it to use the image [[:file:Flag of the United Kingdom.svg]] if it sees any of <nowiki>[[category:UK]] [[Catégorie:uK|some sort key]] {{UK}} {{uK}}</nowiki> etc (Note, however, this will not recognize templates that take parameters, like <nowiki>{{UK|foo}}</nowiki>. This mapping should be modified for the templates/categories in use here at fr. Make sure when modifying this map, each line except for the last one ends in a comma. Cheers. let me know if you find any more issues. [[Utilisateur:Bawolff|Bawolff]] 1 décembre 2009 à 00:04 (UTC)