Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check and translate errors/exceptions displayed on screen or returned in API calls #1351

Closed
halfdan opened this issue May 11, 2010 · 35 comments
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone

Comments

@halfdan
Copy link
Member

halfdan commented May 11, 2010

I saw that core/Access.php has lots of strings that are not getting translated. This should be fixed.
Keywords: translation

@robocoder
Copy link
Contributor

Yes, lots of exception string messages to translate...

@mattab
Copy link
Member

mattab commented May 13, 2010

Yeah let's rename this ticket to include all Exception or error messages (displayed to the user screen) yet to be translated.

@julienmoumne
Copy link
Member

I propose to do it file by file. Here is core/API/Proxy.php

@julienmoumne
Copy link
Member

Attachment:
core.API.Proxy.patch

@julienmoumne
Copy link
Member

Attachment:
core.API.Request.patch

@julienmoumne
Copy link
Member

Please advise on message key string for exception /core/Archive/Array/IndexedBySite.php#111 :

throw new Exception("Piwik_Archive_Array_IndexedBySite::getDataTableFromNumeric() algorithm won't work if data is stored in different tables");

@julienmoumne
Copy link
Member

Attachment:
core.Archive.Single.patch

@julienmoumne
Copy link
Member

Attachment:
core.ArchiveProcessing.Period.patch

@julienmoumne
Copy link
Member

Attachment:
core.DataTable.Rendered.Rss.patch

@julienmoumne
Copy link
Member

Attachment:
core.DataTable.Renderer.Xml.patch

@julienmoumne
Copy link
Member

Attachment:
core.DataTable.Filter.patch

@julienmoumne
Copy link
Member

Attachment:
core.DataTable.Manager.patch

@julienmoumne
Copy link
Member

Attachment:
core.DataTable.Renderer.2.patch

@julienmoumne
Copy link
Member

Attachment:
core.DataTable.Renderer.patch

@julienmoumne
Copy link
Member

do not consider file core.DataTable.Renderer.2.patch

@julienmoumne
Copy link
Member

Attachment:
core.DataTable.Row.patch

@julienmoumne
Copy link
Member

Attachment:
core.Period.Day.patch

@julienmoumne
Copy link
Member

Attachment:
core.Period.patch

@julienmoumne
Copy link
Member

Attachment:
core.Period.Range.patch

@julienmoumne
Copy link
Member

Please advise on message key string for exceptions :

/core/SmartyPlugins/function.loadJavascriptTranslations.php#37 :

throw new Exception("The smarty function loadJavascriptTranslations needs a 'plugins' parameter.");

/core/SmartyPlugins/function.postEvent.php#34 :

throw new Exception("The smarty function postEvent needs a 'name' parameter.");

/core/SmartyPlugins/modifier.money.php#22 :

throw new Exception('the smarty modifier money expects one parameter: the idSite.');

@julienmoumne
Copy link
Member

Attachment:
core.Tracker.Db.Pdo.Mysql.patch

@julienmoumne
Copy link
Member

Attachment:
core.Tracker.Db.Mysqli.patch

@julienmoumne
Copy link
Member

Attachment:
core.Tracker.Generator.patch

@julienmoumne
Copy link
Member

Attachment:
core.Tracker.GoalManager.patch

@julienmoumne
Copy link
Member

Attachment:
core.Tracker.Visit.patch

@julienmoumne
Copy link
Member

Attachment:
core.Updates.0.4.4.patch

@julienmoumne
Copy link
Member

Attachment:
core.Updates.0.5.4.patch

@julienmoumne
Copy link
Member

Attachment:
core.Updates.0.6-rc1.patch

@mattab
Copy link
Member

mattab commented May 24, 2010

Julien, thanks for the patches - can you please submit one patch that contains all changes?

Otherwise, there are many exception messages that don't need to be translated, as they are never displayed on screen (or when they are, this is not an expected error and it doesn't need to be translated).

Example of exceptions that should never display on user screen (unless a plugin is buggy, or something else went very wrong) and therefore don't need to be translated:

  • 'General_ExceptionInvalidInputDate'
  • 'General_ExceptionSubtableAlreadyAssociated'
  • 'General_ExceptionRSSFeedInvalidDataTable'
  • 'General_ExceptionIDArchiveNull'
  • 'General_ExceptionInvalidAPI'
  • etc.
    Also I didn't find General_ExceptionMysqliCharsetFailed in the code?

Basically all exceptions that we translate should not mention 'code specific' issues and should let the user know, in non technical terms, what the error is and why it happened. Let me know if that makes sense

@mattab
Copy link
Member

mattab commented May 24, 2010

Replying to JulienM:

Please advise on message key string for exceptions :

/core/SmartyPlugins/function.loadJavascriptTranslations.php#37 :

throw new Exception("The smarty function loadJavascriptTranslations needs a 'plugins' parameter.");

/core/SmartyPlugins/function.postEvent.php#34 :

throw new Exception("The smarty function postEvent needs a 'name' parameter.");

/core/SmartyPlugins/modifier.money.php#22 :

throw new Exception('the smarty modifier money expects one parameter: the idSite.');

these strings don't need to be translated as they would not appear on screen except during the development of a plugin (and in this case, it's OK to show english to the dev)

@julienmoumne
Copy link
Member

Patch 1351.patch externalizes exceptions marked in translated-exceptions.html

@julienmoumne
Copy link
Member

Attachment:
translated-exceptions.html

@julienmoumne
Copy link
Member

Attachment:
1351.patch

@julienmoumne
Copy link
Member

Attachment:
translated-exceptions.xls

@mattab
Copy link
Member

mattab commented May 31, 2010

(In [2246]) Fixes #1351 All error messages displayed to screen/API should not be translated. Thanks JulienM for patch!

I simply refactored the 'you must be have %s access [...]' messages by putting the admin/view/superuser as a parameter in the string

@halfdan halfdan added this to the Piwik 0.6.3 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

4 participants