Item12375: revive this plugin

pencil
Priority: Enhancement
Current State: Closed
Released In: n/a
Target Release:
Applies To: Extension
Component: TopicTranslationsPlugin
Branches: trunk
Reported By: MichaelDaum
Waiting For: AntonioTerceiro
Last Change By: MichaelDaum
Multiple issues:

  • no use strict; use warnings;
  • several non-declared variables
  • macros should be registered properly instead of using commonTagsHandler
  • DEFAULTLANGUAGE not working properly
  • too many global variables
  • better don't use plugin topic preferences for performance reasons
  • lazy-load I18N::AcceptLanguage
  • missing use Foswiki::Func;
  • detecting a view action did not work properly on short urls and/or lighttpd
  • processing macro params (i.e. the topic one) inconsistent ... better use core apis
  • don't issue a redirect when calling foswiki from the command line

See patch: TopicTranslationsPlugin.patch

Antonio, let me know how to proceed.

-- MichaelDaum - 31 Jan 2013

Hey Michael.

Your patch looks good, thanks for this revamping to the current standards!

I have some comments, though.

I'd prefer to keep using $defaultLanguage instead of $translations[0] thoughout the code, because the former is more clear. Someone else who comes into this code won't keep wondering what's special about the first translation.

Since you are removing the possibility to set the default language as a plugin preference (and I agree with it), make sure you also remove the mention of that from the documentation.

I didn't test your changes, but could you please make sure it does not break on Foswiki 1.0.x?

Please feel free to release a new version with your changes. smile

-- AntonioTerceiro - 01 Feb 2013

Okay will take care of your code suggestions. Unfortunately I don't have a 1.0.x at hand. Can you take over checking that? Made a new release to ease installation.

-- MichaelDaum - 01 Feb 2013
 

Topic revision: r9 - 01 Feb 2013, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy