Bug 115795 - "Get Online Help" under zh-tw locale would be redirected to zh-cn forum
Summary: "Get Online Help" under zh-tw locale would be redirected to zh-cn forum
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.0.1.1 release
Hardware: All All
: medium normal
Assignee: Franklin Weng
URL:
Whiteboard: target:6.1.0 target:6.0.3 target:5.4.7
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-17 08:08 UTC by Franklin Weng
Modified: 2018-11-04 03:34 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Franklin Weng 2018-02-17 08:08:30 UTC
Description:
The new feature "Get Online Help" since LibreOffice 6.0 would by default launch the web site to 

https://hub.libreoffice.org/forum/?LOlang={UIlocale}

However under the locale zh-tw, when clicking "Help > Get Online Help" it would launch

https://hub.libreoffice.org/forum/?LOlang=zh

instead of

https://hub.libreoffice.org/forum/?LOlang=zh-tw

the former would hence be redirected to

which would redirected to https://www.libreofficechina.org

Steps to Reproduce:
1. Open LibreOffice 6.0 under locale zh-tw
2. Click Help > Get Online Help
3.

Actual Results:  
Redirected to https://www.libreofficechina.org

Expected Results:
Redirected to https://ask.libreoffice.org/zh-tw/questions/


Reproducible: Always


User Profile Reset: No



Additional Info:
Change the behavior of Help > Get Online Help under zh-tw locale from launching

https://hub.libreoffice.org/forum/?LOlang=zh

to 

https://hub.libreoffice.org/forum/?LOlang=zh-tw


User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36
Comment 1 Franklin Weng 2018-02-17 09:15:02 UTC
The problem seems to be here:

https://opengrok.libreoffice.org/xref/core/sfx2/source/appl/appserv.cxx

Line 500:

        case SID_Q_AND_A:
        {
            // Askbot has URL's normalized to languages, not locales
            // Get language from locale: ll or lll or ll-CC or lll-CC
            OUString aLang = LanguageTag(utl::ConfigManager::getLocale()).getLanguage();
            OUString sURL("https://hub.libreoffice.org/forum/?LOlang=" + aLang);
            sfx2::openUriExternally(sURL, false);
            break;
        }

The aLang got the wrong value, should be "zh-tw" instead of "zh".

However the locale shown in the about dialog is correct:

版本:6.0.1.1
組建 ID:1:6.0.1~rc1-0ubuntu0.16.04.1~lo1
CPU 執行緒:4; OS:Linux 4.11; UI 算繪:預設; VCL: kde4; 
語言地區:zh-TW (zh_TW.UTF-8); Calc: group
Comment 2 Xisco Faulí 2018-02-23 13:36:33 UTC
Patch in gerrit: https://gerrit.libreoffice.org/#/c/50230/

Moving to ASSIGNED

@Franklin, thanks for taking care of it.
Comment 3 Commit Notification 2018-02-28 14:40:33 UTC
Franklin Weng committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7c1f11985c0b42981cf8600840fb87521ce5ad33

tdf#115795 Solve wrong redirect behavior of "Get Online Help"

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2018-02-28 15:39:02 UTC
Franklin Weng committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5fefbde340ed3bb7591f2301282e986c1caf2ee9&h=libreoffice-6-0

tdf#115795 Solve wrong redirect behavior of "Get Online Help"

It will be available in 6.0.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2018-03-01 07:33:14 UTC
Franklin Weng committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c008e38e1069f33a20af63eedc4bc7e6ebf5278d&h=libreoffice-5-4

tdf#115795 Solve wrong redirect behavior of "Get Online Help"

It will be available in 5.4.7.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Xisco Faulí 2018-04-03 11:00:03 UTC
A polite ping to Franklin Weng: is this bug fixed? if so, could you
please close it as RESOLVED FIXED ? Thanks
Comment 7 Franklin Weng 2018-04-03 11:25:11 UTC
polite pong to Xisco: It fixed in 6.0.3.2.

Thanks.