Traceback (most recent call last):
File "/data/data/com.termux/files/home/vikaspy/pwb.py", line 399, in
<module>
if not main():
File "/data/data/com.termux/files/home/vikaspy/pwb.py", line 391, in main
run_python_file(filename,
File "/data/data/com.termux/files/home/vikaspy/pwb.py", line 106, in
run_python_file
exec(compile(source, filename, 'exec', dont_inherit=True),
File "./scripts/replace.py", line 1075, in <module>
main()
File "./scripts/replace.py", line 929, in main
single_summary = i18n.twtranslate(
File
"/data/data/com.termux/files/home/vikaspy/pywikibot/tools/_deprecate.py",
line 404, in wrapper
return obj(*__args, **__kw)
File "/data/data/com.termux/files/home/vikaspy/pywikibot/i18n.py", line
700, in twtranslate
raise pywikibot.exceptions.TranslationError(
pywikibot.exceptions.TranslationError: Unable to load messages package
scripts.i18n for bundle replace-replacing
It can happen due to lack of i18n submodule or files. See
https://www.mediawiki.org/wiki/Manual:Pywikibot/i18n
CRITICAL: Exiting due to uncaught exception <class
'pywikibot.exceptions.TranslationError'>
$
Hi all,
I'm building a small pywikibot tool[1] which is designed to be installed
via pip (and in turn installs Pywikibot via pip).
The tool uses the page.touch() function which is where I get a
pywikibot.i18n.TranslationError when I run it.
page.touch() gets it's edit summary from i18n.twtranslate(self.site,
'pywikibot-touch') which in turn is defined in /scripts/i18n/pywikibot/.
Unless I'm confused the Error occurs because the pip distribution does not
include the /scripts folder or the i18n submodule.
So my first question is am I just doing something obviously wrong and the
i18n submodule should have been available over pip as well?
If it's not just me then would it not make sense to have any i18n files
necessary to the Pywikibot *library* to also be distributed via the same
pip package? (i18n for scripts is another issue since for scripts you
cannot use pip).
Cheers,
André / Lokal_Profil
[1] https://github.com/lokal-profil/pywikibot-sdc
André Costa | Chief Operating Officer, Wikimedia Sverige |
Andre.Costa(a)wikimedia.se | +46 (0)733-964574
Stöd fri kunskap, bli medlem i Wikimedia Sverige.
Läs mer på blimedlem.wikimedia.se
------
sent from my mobile, all typos are due to autocorrect ;)
(This change is relevant for all Wikidata users working with labels,
descriptions, and aliases.)
Based on a long-standing community request we have enabled a new language
code for labels, descriptions, and aliases on Test Wikidata: “mul”, a
special language code meaning “multiple languages”. It is intended to
replace the current duplication of certain labels and aliases in many
languages: instead of the given name Douglas (Q463035)
<https://www.wikidata.org/wiki/Q463035> having the label “Douglas” in
hundreds of Latin-script languages, it should be enough to add it once as
the “mul” label and have all other languages falling back to that (before,
as usual, falling back to “en” as a last resort). This should reduce the
amount of redundant data in Wikidata, and relieve some pressure from the
query service. A big thank you goes to all people involved in the
discussions!
The purpose of the Test Wikidata version of this feature is to determine
whether the current functionality is already sufficient, or whether the
feature needs more work before it can be enabled on Wikidata proper.
Current implementation:
-
You can interact with the new language code using the API.
-
The new language code appears in the table of labels at the top of an
item page for users whose Babel information includes “mul” (or who use ?
uselang=mul in the URL). If there is already a “mul” label, it will be
available for everyone under the usual “all entered languages” option.
-
The page heading will fall back to the “mul” label if necessary.
Fallbacks to “mul” have the usual “indicator” that shows a fallback took
place (CSS class wb-language-fallback-mul).
For more details, see T285156 <https://phabricator.wikimedia.org/T285156>
(or T297393 <https://phabricator.wikimedia.org/T297393> for the Test
Wikidata implementation). You are welcome to leave any feedback about the
technical implementation of the new language code on these tickets.
The new language code will very likely need adjustment of Wikidata policies
and guidelines. In case you would like to contribute to drafting
preliminary new guidelines, a good starting point is: Help
talk:Label#Drafting of guidelines for new language code mul
<https://www.wikidata.org/wiki/Help_talk:Label#Drafting_of_guidelines_for_ne…>
.
Cheers,
--
Mohammed Sadat
*Community Communications Manager for Wikidata/Wikibase*
Wikimedia Deutschland e. V. | Tempelhofer Ufer 23-24 | 10963 Berlin
Phone: +49 (0)30 219 158 26-0
https://wikimedia.de
Keep up to date! Current news and exciting stories about Wikimedia,
Wikipedia and Free Knowledge in our newsletter (in German): Subscribe now
<https://www.wikimedia.de/newsletter/>.
Imagine a world in which every single human being can freely share in the
sum of all knowledge. Help us to achieve our vision!
https://spenden.wikimedia.de
Wikimedia Deutschland – Gesellschaft zur Förderung Freien Wissens e. V.
Eingetragen im Vereinsregister des Amtsgerichts Berlin-Charlottenburg unter
der Nummer 23855 B. Als gemeinnützig anerkannt durch das Finanzamt für
Körperschaften I Berlin, Steuernummer 27/029/42207.