Page MenuHomePhabricator

Error trying to translate SVG: "Fatal error: Call to protected method Intuition::getLangNames()"
Closed, ResolvedPublic

Description

Hey, I want to translate a certain svg file however every time i try to i get this error:

testing File:Planetary transit.svg on https://commons.wikimedia.org/w/api.php Fatal error: Call to protected method Intuition::getLangNames() from context 'SVGtranslate' in /data/project/svgtranslate/public_html/svgtranslate.php on line 395 Call Stack: 0.0039 675248 1. {main}() /data/project/svgtranslate/public_html/index.php:0 0.1270 3318376 2. SVGtranslate->do_step() /data/project/svgtranslate/public_html/index.php:57 0.1270 3318512 3. SVGtranslate->generate_second_form() /data/project/svgtranslate/public_html/svgtranslate.php:781

Thanks in advance

Event Timeline

Mikey641 created this task.Jun 27 2016, 7:17 PM
Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJun 27 2016, 7:17 PM
Aklapper renamed this task from SVG Translate Tool to Error trying to translate SVG: "Fatal error: Call to protected method Intuition::getLangNames()".Jul 12 2016, 7:52 AM
Aklapper removed Jarry1250 as the assignee of this task.
Aklapper added a subscriber: Jarry1250.
Glrx updated the task description. (Show Details)Oct 18 2016, 9:15 PM
Glrx added a subscriber: Glrx.
Glrx added a subscriber: Krinkle.Oct 18 2016, 11:06 PM

Subscribe Krinkle

Glrx added a comment.Oct 19 2016, 1:01 AM

This is an error in Intuition: the code does not match the spec.
The published specification for Intuition claims a public interface for getLangNames:

https://github.com/Krinkle/intuition/wiki/Documentation

A edit in March 2016 changed "public getLangNames" to "protected getLangNames".

https://github.com/Krinkle/intuition/commit/9daa30e6cdaa88999a39418ca115c07ceff36956

See line 661 of
https://github.com/Krinkle/intuition/blob/master/includes/Intuition.php

Glrx updated the task description. (Show Details)Oct 19 2016, 1:06 AM
Krinkle added a comment.EditedOct 19 2016, 9:39 PM

@Glrx I've made it public again and updated the Tool Labs installation. This method was made private in favour of the new getAvailableLangs() method. The problem was that getLangNames() includes many languages that do not have any translations available for the interface. And the main use case of getLangNames() was to create a drowndown menu to change the tool interface language. getAvailableLangs() is better for that purpose.

However, for SVGTranslate you do want to include languages that don't have a translation in the tool interface since its language strings are unrelated.

@Jarry1250 To prevent this in the future, please migrate SVGTranslate to a local Intuition installation through Composer. (read Migrate). This is more secure, more performance. That way, you will also be in control of when you update the Intuition framework code - separate from receiving translation updates.

Right now SVGTranslate uses the (shared) copy of the framework used by the tools.wmflabs.org/intuition/ dashboard.

Instructions at https://github.com/Krinkle/intuition/wiki/Migrate. Let me know if you need help. Contact me on IRC or by e-mail (see profile).

Krinkle assigned this task to Jarry1250.Oct 19 2016, 9:40 PM
Krinkle closed this task as Resolved.
Krinkle claimed this task.

Now there is a different problem.
Whenever I try to upload a file i get a "error-filename"

@Mikey641: Please create a separate task for different problems. Thanks! :)