stephenharris / Event-Organiser

WordPress plug-in, Event Organiser, development repository
http://wordpress.org/extend/plugins/event-organiser/
GNU General Public License v3.0
100 stars 76 forks source link

problems with translate.wordpress.org in the recognition of text strings #370

Open kniebremser opened 8 years ago

kniebremser commented 8 years ago

Hi! There is a large discrepancy in the translatable texts. Your pot-file says 480 strings and translate.wordpress.org recognizes only 424 . When I scan the directory with Poedit I get an error message from xgettext.exe: Not in ASCII encoded string at or before js/fullcalendar.min.js:. 2 Please encoding of the source code with --from-code specify.

If I file delete, the scan is performed completely.

stephenharris commented 8 years ago

Not sure why Poedit is having trouble with fullcalendar.min.js but I don't think it should be scanning it (or at least, there's nothing in there to translate so it doesn't need to). Currently WordPress' translations only support PHP files anyway.

I don't know how translate.wordpress.org scans the plug-in but 480 is what I get. At a guess, there are numerous strings in Event Organiser which do not specify a domain (and so piggy-pack of Core's translation files). It could well be that wordpress.org strips those out, whereas the .pot in this repo keeps them in.

stephenharris commented 8 years ago

A quick scan puts strings without a domain at 39. Doesn't quite account for the 56.

stephenharris commented 8 years ago

Come to think of it, that count is counting translation functions not strings. When you have plurals you have two strings for one function instance - so it could be that those 39 instances of using a translation function without a domain actually corresponds to 56 translatable strings.

kniebremser commented 8 years ago

Are missing a lot of texts. a lot of texts. For example: anything with Google API Key and timezone settings. If I take the po-file from translate.wordpress.org and update with the pot file, tells me PoEdit new strings: 97 and obsolete strings: 41 They are all strings plugin specific see screenshot ice_screenshot_20160713-004016

kniebremser commented 8 years ago

The German translation is to translated 100%.

stephenharris commented 8 years ago

I guess translate.wordpress.org/projects/wp-plugins/event-organiser just lags behind then. I don't manage it or now how they scan the plug-in to generate the .pot file. It's all done by wordpress.org.

kniebremser commented 8 years ago

Perhaps I have found the error. in includes / event-organizer-cpt.php line 61 There I counted 9 x " "An even number must be always And as some text strings also " use the parser from translate.wordpress.org gets confused

Sorry! The file is classes/class-eo-agenda.widget.php line 61

stephenharris commented 8 years ago

Good spot, but I doubt that's the cause. Apart from anything else, the latest strings referring to the Google maps API key are missing, and they are in a different page.

Anyhow, there is a stray " in that line. I did a quick scan and found these files all had an odd number of ":

  97   ./classes/class-eo-agenda-widget.php
  45   ./classes/class-eventorganiser-shortcodes.php
 109   ./includes/class-eo-ical-parser.php
  79   ./templates/ical.php

But the last three are all false positives (e.g. https://github.com/stephenharris/Event-Organiser/blob/ac618a94042607ed8e61b3ee97ad5d8e90407624/includes/class-eo-ical-parser.php#L907).

Additionally a single " is perfectly valid php, so I doubt this is the cause of the missing translation. It's not, however, strictly valid HTML.

kniebremser commented 8 years ago

Meanwhile, I have learned the ways of code are unfathomable. Effect and cause are often not in the same place. Enough phrases. Anyway Polyglots anything like here in the code. I demand, there were no error messages when you parse the text in Polyglots. There has the tool "Eclipse Neon" nothing to complain about. "Eclipse Neon" has found a few other HTML problems. See the screenshot

ice_screenshot_20160713-135755

The things found definitely have nothing to do with the translations, maybe they can, if there are no fake messages, be rectified.

stephenharris commented 8 years ago

Thanks, there are some valid warnings in there. The undefined attributes eo-loop-single-event.php refer to microdata. They'll be flagged if the validator being used doesn't recognise microdata.

The invalid location of script/styles are referring to inline style/script tags. I'm not going to fix those because there isn't much point, it's perfectly valid and in any case the referenced pages are non-essential and largely hidden admin pages.

kniebremser commented 8 years ago

I've been thinking, these are the most false alarms. Are strained after the next release of the impact on t.w.o

stephenharris commented 8 years ago

What's t.w.o?

kniebremser commented 8 years ago

Acronym for translate.wordpress.org

kniebremser commented 8 years ago

The changes have no positive effect. Now the only line: https://github.com/stephenharris/Event-Organiser/blob/ac618a94042607ed8e61b3ee97ad5d8e90407624/includes/class-eo-ical-parser.php#L907

Then there is another possibility: t.w.o has problems with the "text strings" Perhaps it may only 'text strings'