1
Cesagonchu
Module translation and special characters

Important!
To all module translators, who use special characters, change all words that contain these characters because it causes bugs.
Also remove spaces between words. You can use - and _ as replacements.
This concerns only the words on the administration side of the module.

Good luck, there is a lot to do.

EDIT: I just noticed that the English modules also have this problem.
For example the News module on the administration side contains these words:
"Topics manager" "Post/Edit news" "Blocks admin" "Prune news" "News export"
There are spaces between the words and also a slash!

Cedric has made a patch on his fork

2
alain01
Re: Module translation and special characters
  • 2021/11/30 23:33

  • alain01

  • Just can't stay away

  • Posts: 528

  • Since: 2003/6/20


???

What ?

You mean that ""Topics manager" should be "Topics_manager" to avoid a bug?
lol ?
We can't write "Topics_manager", not in 2021, it's not a variable, it's a label displayed for the webmaster.

3
Mamba
Re: Module translation and special characters
  • 2021/12/1 1:17

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


I am not sure I understand it. What is wrong with "Topics manager" or "Post/Edit news" ? What exactly is the problem?

This has been forever and was always working just fine
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

4
zyspec
Re: Module translation and special characters
  • 2021/12/1 3:41

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


The HTML 'id' has historically only allowed [A-Za-z0-9-_:.], and the string must start with [A-Za-z] and not be empty. In other words a '/', space or accented chars, etc. are not valid for an id attribute. For HTML5 the only requirement is that it can't be empty and can't contain a space.

Any code that uses a var for the HTML4 id should sanitize it first...

Maybe something like:
$idAttrib preg_replace('/^[A-Za-z]+([A-Za-z\d-_:.])*?$/''_'$id);
$idAttrib = !empty($idAttrib) ?? 'A' . (string)rand(1,32767); // create a random ID if it's currently empty


For HTML5 just make sure that it's not empty and replace any spaces with an underscore. So something as simple as:
$idAttrib str_replace(' ''_'$id);
$idAttrib = !empty($idAttrib) ?? 'A' . (string)rand(1,32767); // create a random ID if it's currently empty

5
alain01
Re: Module translation and special characters
  • 2021/12/1 6:39

  • alain01

  • Just can't stay away

  • Posts: 528

  • Since: 2003/6/20


Thank you Zyspec for this clear explanation

6
Cesagonchu
Re: Module translation and special characters

To solve the problem, Cedric made a pull request here:
https://github.com/XOOPS/XoopsCore25/pull/1133

7
alain01
Re: Module translation and special characters
  • 2021/12/1 10:50

  • alain01

  • Just can't stay away

  • Posts: 528

  • Since: 2003/6/20


yes I had seen but I didn't understand Cedric's explanation in the PR.
With the additional explanation given by Zyspec, it is clear and I now understand Cedric's explanation

8
zyspec
Re: Module translation and special characters
  • 2021/12/1 16:01

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Glad the explanation helped. In this case Cedric's change should fix this particular issue.

Login

Who's Online

189 user(s) are online (115 user(s) are browsing Support Forums)


Members: 0


Guests: 189


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits