2024-03-28 14:37 UTC

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002266NetSurfRISC OS-specificpublic2018-08-29 14:01
ReporterDick Tanis 
Assigned To 
SeverityminorReproducibilityalways 
StatusclosedResolutionfixed 
PlatformOSRISC OSOS Version4.x 5.x
Product Version3.2 
Target Version3.8Fixed in Version3.8 
Summary0002266: URLs about:welcome, about:credits and about:licence don't load localized version when the corresponding files are available
DescriptionWhen UI and/or website language in NS is configured into for example German or Dutch and about:welcome, about:credits or about:licence is opened always the English HTML-pages from Resources.en are opened even when the corresponding language dir contains a localized version of the HTML file.
Steps To ReproduceGet NS version 2564. Start it. Configure UI and website language to 'Nederlands'. Restart NS. The English Welcome page is displayed instead of the Dutch one.

Go to main window. Open menu and go to 'Help' and select 'Credits' and 'Licence'. The English versions of those pages are opened instead of the Dutch ones.
TagsNo tags attached.
Fixed in CI build #4302
Reported in CI build #2564
URL of problem pageabout:welcome, about:licence, about:credits
Attached Files
  • patch file icon langresource.patch (680 bytes) 2015-03-04 20:09 -
    --- netsurf/riscos/gui.c	2015-03-04 13:03:57.690383135 +0100
    +++ workspace/netsurf/riscos/gui.c	2015-03-04 12:03:18.138372914 +0100
    @@ -194,6 +194,7 @@
     	static const char base_url[] = "file:///NetSurf:/Resources/";
     	size_t path_len, length;
     	char *raw;
    +	char langdir[4];
     	nsurl *url = NULL;
     
     	/* Map paths first */
    @@ -232,8 +233,9 @@
     		if (path_len > SLEN(".html") &&
     				strncmp(path + path_len - SLEN(".html"),
     					".html", SLEN(".html")) == 0) {
    -			memcpy(ptr, "en/", SLEN("en/"));
    -			ptr += SLEN("en/");
    +			sprintf(langdir, "%s/", nsoption_charp(language));
    +			memcpy(ptr, langdir, SLEN(langdir));
    +			ptr += SLEN(langdir);
     		}
     
     		/* Add filename to URL */
    
    patch file icon langresource.patch (680 bytes) 2015-03-04 20:09 +
  • patch file icon gui.patch (612 bytes) 2015-08-13 07:41 -
    --- riscos/guiorg.c	2015-08-13 08:23:20.0 +0100
    +++ riscos/gui.c	2015-08-13 08:23:20.0 +0100
    @@ -228,13 +228,11 @@
     		ptr += SLEN(base_url);
     
     		/* Add language directory to URL, for translated files */
    -		/* TODO: handle non-en langauages
    -		 *       handle non-html translated files */
    +		/* TODO: handle non-html translated files */
     		if (path_len > SLEN(".html") &&
     				strncmp(path + path_len - SLEN(".html"),
     					".html", SLEN(".html")) == 0) {
    -			memcpy(ptr, "en/", SLEN("en/"));
    -			ptr += SLEN("en/");
    +			ptr += sprintf(ptr, "%s/", ro_gui_default_language());
     		}
     
     		/* Add filename to URL */
    
    patch file icon gui.patch (612 bytes) 2015-08-13 07:41 +
  • patch file icon gui-2.patch (721 bytes) 2017-06-10 15:36 -
    diff --git a/frontends/riscos/gui.c b/frontends/riscos/gui.c
    index 576e1ff..219515e 100644
    --- a/frontends/riscos/gui.c
    +++ b/frontends/riscos/gui.c
    @@ -230,13 +230,11 @@ static nsurl *gui_get_resource_url(const char *path)
     		ptr += SLEN(base_url);
     
     		/* Add language directory to URL, for translated files */
    -		/* TODO: handle non-en langauages
    -		 *       handle non-html translated files */
    +		/* TODO: handle non-html translated files */
     		if (path_len > SLEN(".html") &&
     				strncmp(path + path_len - SLEN(".html"),
     					".html", SLEN(".html")) == 0) {
    -			memcpy(ptr, "en/", SLEN("en/"));
    -			ptr += SLEN("en/");
    +			ptr += sprintf(ptr, "%s/", ro_gui_default_language());
     		}
     
     		/* Add filename to URL */
    
    patch file icon gui-2.patch (721 bytes) 2017-06-10 15:36 +

-Relationships
+Relationships

-Notes
Dick Tanis

~0000627

Dick Tanis (reporter)

Supplied patch which fixes this problem. It's not perfect but it works.
Sprow

~0000898

Sprow (reporter)

I think it would be more consistent to use ro_gui_default_language() to construct the about: URIs since that's where the other application resources are retrieved from.

Also, since sprintf() returns the number of characters emitted we can use its return value to increment ptr directly.
Sprow

~0001570

Sprow (reporter)

This patch (to use sprintf of ro_gui_default_language instead of hardwired 'en') still seems to apply cleanly to the latest sources. Could it be integrated?
John-Mark Bell

~0001714

John-Mark Bell (administrator)

Fixed in 4302. sprintf approach is fine, but I disliked the assumption that ro_gui_default_language() returned a string that was 2 characters long, so the preceding length calculation has been updated to take account of the actual length of the language identifier.
Vincent Sanders

~0001832

Vincent Sanders (administrator)

Thank you for your report, this has been resolved in the 3.8 release
+Notes

-Issue History
Date Modified Username Field Change
2015-02-01 06:38 Dick Tanis New Issue
2015-02-04 09:03 Vincent Sanders Status new => confirmed
2015-02-16 14:12 Michael Drake Assigned To => Steve Fryatt
2015-03-04 20:09 Dick Tanis File Added: langresource.patch
2015-03-04 20:11 Dick Tanis Note Added: 0000627
2015-08-13 07:41 Sprow File Added: gui.patch
2015-08-13 07:43 Sprow Note Added: 0000898
2015-10-31 21:58 Vincent Sanders Assigned To Steve Fryatt =>
2017-06-10 15:36 Sprow File Added: gui-2.patch
2017-06-10 15:36 Sprow Note Added: 0001570
2018-01-21 14:29 John-Mark Bell Status confirmed => resolved
2018-01-21 14:29 John-Mark Bell Resolution open => fixed
2018-01-21 14:29 John-Mark Bell Fixed in Version => 3.8
2018-01-21 14:29 John-Mark Bell Target Version => 3.8
2018-01-21 14:29 John-Mark Bell Fixed in CI build # => 4302
2018-01-21 14:29 John-Mark Bell Note Added: 0001714
2018-08-29 14:01 Vincent Sanders Status resolved => closed
2018-08-29 14:01 Vincent Sanders Note Added: 0001832
+Issue History