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

Add Translate extension to Wiki #568

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lectrician1
Copy link

@lectrician1 lectrician1 commented Feb 5, 2023

This adds the Translate extension to the Wiki.

All other extension dependencies have already been installed so no other extensions are added as part of this request.

User rights and the new role of "translateadmin" have been configured according to the original proposal.

The OSM ElasticSearch server will now be utilized for storing translation memories.

Closes openstreetmap/operations#649

@tomhughes tomhughes force-pushed the master branch 2 times, most recently from 3b728d8 to 4ae2339 Compare March 5, 2023 12:47
@tomhughes tomhughes force-pushed the master branch 2 times, most recently from 3cc04b0 to 82f971c Compare May 2, 2023 23:46
@tomhughes tomhughes force-pushed the master branch 2 times, most recently from 749a519 to b7e5b92 Compare July 4, 2023 09:37
@lectrician1
Copy link
Author

Could someone please review this? It has been over a year since the proposal passed to add this.

@Firefishy
Copy link
Member

Can you tell me what functionality this introduces?

@lectrician1
Copy link
Author

@Firefishy Please see the proposal for an in-depth description about what functionality it offers.

@tomhughes tomhughes force-pushed the master branch 2 times, most recently from 0305831 to e3574f3 Compare August 3, 2023 08:00
@lectrician1
Copy link
Author

lectrician1 commented Aug 9, 2023

So... update?

@Firefishy
Copy link
Member

Will you be around when this causes the wiki to break or block upgrades? This is a fairly deep plugin. I am not comfortable supporting it on my own.

@lectrician1
Copy link
Author

I will be. Honestly I have not tested this PR with the current Wiki stack since I don't have chef setup or anything and don't really know how to set it up. I guess creating that docker container for the wiki which has been something I've wanted to do we might think of doing before this as well to test it (openstreetmap/operations#873).

@pnorman
Copy link
Collaborator

pnorman commented Aug 10, 2023

If we install it and then have to remove it in a couple months, what are the consequences? What's the uninstall procedure?

@lectrician1
Copy link
Author

@pnorman All the pages created as "translated" pages will just be kept in normal page form. For example, Key:Highway and its Spanish translation produced by the Translate extension at Key:Highway/es will become normal pages at Key:Highway and Key:Highway/es. We will need to add the {{Languages}} template to those pages but that should be pretty easy to automate.

Comment on lines +27 to +36
$wgTranslateTranslationServices['TTMServer'] = array(
'type' => 'ttmserver',
'class' => 'ElasticSearchTTMServer',
'cutoff' => 0.75,
/*
* See http://elastica.io/getting-started/installation.html
* See https://github.com/ruflin/Elastica/blob/8.x/src/Client.php
*/
'config' => [ 'servers' => [ 'host' => '127.0.0.1', 'port' => 9114 ] ]
);
Copy link

@lens0021 lens0021 May 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$wgTranslateTranslationServices['TTMServer'] = array(
'type' => 'ttmserver',
'class' => 'ElasticSearchTTMServer',
'cutoff' => 0.75,
/*
* See http://elastica.io/getting-started/installation.html
* See https://github.com/ruflin/Elastica/blob/8.x/src/Client.php
*/
'config' => [ 'servers' => [ 'host' => '127.0.0.1', 'port' => 9114 ] ]
);
$wgTranslateTranslationServices['TTMServer'] = [
'type' => 'ttmserver',
'class' => 'ElasticSearchTTMServer',
'cutoff' => 0.75,
/*
* See http://elastica.io/getting-started/installation.html
* See https://github.com/ruflin/Elastica/blob/8.x/src/Client.php
*/
'config' => [ 'servers' => [ 'host' => '127.0.0.1', 'port' => 9114 ] ]
];

The mix use of old syntax and new syntax has slightly confused me :)


wfLoadExtension( 'Translate' );
$wgGroupPermissions['user']['translate'] = true;
$wgGroupPermissions['user']['skipcaptcha'] = true; // Bug 34182: needed with ConfirmEdit

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though the bug, I am not sure if it is good to disable the captcha for all logged-in users.
In another perspective, does OSM wiki have ConfirmEdit enabled? (Is this line needed?)
Anyway, I think it would be good if 'autoconfirmed' is used than 'user'.

Comment on lines +19 to +23
/**
* Add a preference "Do not send me email newsletters" in the email preferences.
*/
$wgTranslateNewsletterPreference = true;

Copy link

@lens0021 lens0021 May 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/**
* Add a preference "Do not send me email newsletters" in the email preferences.
*/
$wgTranslateNewsletterPreference = true;

This configuration variable removed in 2020. (MediaWiki 1.35)

wikimedia/mediawiki-extensions-Translate@1c43244
Bug: T134633

@lens0021
Copy link

Honestly I have not tested this PR with the current Wiki stack since I don't have chef setup or anything and don't really know how to set it up.

@lectrician1 If you can, could you please take the time to test it with Chef?

If we install it and then have to remove it in a couple months, what are the consequences? What's the uninstall procedure?

@Nikerabbit I am sorry to mention you suddenly. Do you know what will happen if Translate extension is uninstalled? Are there any cases of this happened on any wiki?

@Nikerabbit
Copy link
Contributor

Not to my knowledge. Main changes would be tags would displaying verbatim and all translations would become editable as normal pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Translate extension to main wiki
5 participants