Stop abusing certain Messages; add some dedicated non-crazy HelpHints

svn path=/trunk/netsurf/; revision=13912
This commit is contained in:
Chris Young 2012-05-07 15:06:48 +00:00
parent 9e03315e09
commit 36e9d114ea
4 changed files with 56 additions and 36 deletions

View File

@ -2620,21 +2620,21 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw,
g->shared->svbuffer = AllocVec(2000, MEMF_CLEAR);
g->shared->helphints[GID_BACK] =
remove_escape_chars(messages_get("HelpToolbar0"), true);
translate_escape_chars(messages_get("HelpToolbarBack"));
g->shared->helphints[GID_FORWARD] =
remove_escape_chars(messages_get("HelpToolbar1"), true);
translate_escape_chars(messages_get("HelpToolbarForward"));
g->shared->helphints[GID_STOP] =
remove_escape_chars(messages_get("HelpToolbar2"), true);
translate_escape_chars(messages_get("HelpToolbarStop"));
g->shared->helphints[GID_RELOAD] =
remove_escape_chars(messages_get("HelpToolbar3"), true);
translate_escape_chars(messages_get("HelpToolbarReload"));
g->shared->helphints[GID_HOME] =
remove_escape_chars(messages_get("HelpToolbar4"), true);
translate_escape_chars(messages_get("HelpToolbarHome"));
g->shared->helphints[GID_URL] =
remove_escape_chars(messages_get("HelpToolbar14"), true);
translate_escape_chars(messages_get("HelpToolbarURL"));
g->shared->helphints[GID_SEARCHSTRING] =
remove_escape_chars(messages_get("HelpWebSearch"), true);
translate_escape_chars(messages_get("HelpToolbarWebSearch"));
g->shared->helphints[GID_ADDTAB] =
remove_escape_chars(messages_get("HelpAddTab"), true);
translate_escape_chars(messages_get("HelpToolbarAddTab"));
ami_get_theme_filename(nav_west,"theme_nav_west",false);
ami_get_theme_filename(nav_west_s,"theme_nav_west_s",false);

View File

@ -155,37 +155,26 @@ bool path_add_part(char *path, int length, const char *newpart)
}
/**
* returns a string without escape chars or |M chars.
* returns a string with escape chars translated.
* (based on remove_underscores from utils.c)
* \param translate true to insert a linebreak where there was |M,
* and capitalise initial characters after escape chars.
*/
char *remove_escape_chars(const char *s, bool translate)
char *translate_escape_chars(const char *s)
{
size_t i, ii, len;
char *ret;
bool nextcharupper = false;
len = strlen(s);
ret = malloc(len + 1);
if (ret == NULL)
return NULL;
for (i = 0, ii = 0; i < len; i++) {
if ((s[i] != '\\') && (s[i] != '|')) {
if(nextcharupper) {
ret[ii++] = toupper(s[i]);
nextcharupper = false;
}
else ret[ii++] = s[i];
if (s[i] != '\\') {
ret[ii++] = s[i];
}
else if ((translate) && (s[i] == '|') && (s[i+1] == 'M')) {
else if (s[i+1] == 'n') {
ret[ii++] = '\n';
i++;
}
else {
if(translate) nextcharupper = true;
i++;
}
}
ret[ii] = '\0';
return ret;

View File

@ -18,5 +18,5 @@
#ifndef AMIGA_MISC_H
#define AMIGA_MISC_H
char *remove_escape_chars(const char *s, bool translate);
char *translate_escape_chars(const char *s);
#endif

View File

@ -5015,18 +5015,49 @@ fr.ro.HelpThemePConfig:Cette fenêtre indique les thèmes disponibles.|MLe thèm
it.ro.HelpThemePConfig:This pane shows the available themes.|MThe selected icon theme is used for NetSurf browser \ws, the hotlist, global history and cookie management.
nl.ro.HelpThemePConfig:This pane shows the available themes.|MThe selected icon theme is used for NetSurf browser \ws, the hotlist and global history.
# HelpHint (tooltip) text
# Amiga HelpHint (tooltip) text
#
en.ro.HelpWebSearch:Web search bar.|MType text and press Return to search using your default search provider.
de.ro.HelpWebSearch:Websuchleiste.|MText eingeben und Enter drücken um mit der Standardsuchmaschine zu suchen.
fr.ro.HelpWebSearch:Web search bar.|MType text and press Return to search using your default search provider.
it.ro.HelpWebSearch:\Tdigita una voce in base al provider scelto e premi invio
nl.ro.HelpWebSearch:Web search bar.|MType text and press Return to search using your default search provider.
en.ro.HelpAddTab:Tab add button.|MAdds a new blank tab.
de.ro.HelpAddTab:Tab hinzufügen.
fr.ro.HelpAddTab:Tab add button.|MAdds a new blank tab.
it.ro.HelpAddTab:Apri una nuova scheda
nl.ro.HelpAddTab:Tab add button.|MAdds a new blank tab.
en.ami.HelpToolbarBack:Back\nLMB: Steps back one page\nRMB: Display a menu of recent pages
de.ami.HelpToolbarBack:Back\nLMB: Steps back one page\nRMB: Display a menu of recent pages
fr.ami.HelpToolbarBack:Back\nLMB: Steps back one page\nRMB: Display a menu of recent pages
it.ami.HelpToolbarBack:Back\nLMB: Steps back one page\nRMB: Display a menu of recent pages
nl.ami.HelpToolbarBack:Back\nLMB: Steps back one page\nRMB: Display a menu of recent pages
en.ami.HelpToolbarForward:Forward\nLMB: Steps forward one page
de.ami.HelpToolbarForward:Forward\nLMB: Steps forward one page
fr.ami.HelpToolbarForward:Forward\nLMB: Steps forward one page
it.ami.HelpToolbarForward:Forward\nLMB: Steps forward one page
nl.ami.HelpToolbarForward:Forward\nLMB: Steps forward one page
en.ami.HelpToolbarStop:Stop\nLMB: Stops loading the page
de.ami.HelpToolbarStop:Stop\nLMB: Stops loading the page
fr.ami.HelpToolbarStop:Stop\nLMB: Stops loading the page
it.ami.HelpToolbarStop:Stop\nLMB: Stops loading the page
nl.ami.HelpToolbarStop:Stop\nLMB: Stops loading the page
en.ami.HelpToolbarReload:Reload\nLMB: Reloads the page\nShift+LMB: Reloads the page and all objects
de.ami.HelpToolbarReload:Reload\nLMB: Reloads the page\nShift+LMB: Reloads the page and all objects
fr.ami.HelpToolbarReload:Reload\nLMB: Reloads the page\nShift+LMB: Reloads the page and all objects
it.ami.HelpToolbarReload:Reload\nLMB: Reloads the page\nShift+LMB: Reloads the page and all objects
nl.ami.HelpToolbarReload:Reload\nLMB: Reloads the page\nShift+LMB: Reloads the page and all objects
en.ami.HelpToolbarHome:Home\nLMB: Goes to the homepage
de.ami.HelpToolbarHome:Home\nLMB: Goes to the homepage
fr.ami.HelpToolbarHome:Home\nLMB: Goes to the homepage
it.ami.HelpToolbarHome:Home\nLMB: Goes to the homepage
nl.ami.HelpToolbarHome:Home\nLMB: Goes to the homepage
en.ami.HelpToolbarURL:URL bar\nType a URL and press Return. Suggestions can be selected with up/down.
de.ami.HelpToolbarURL:URL bar\nType a URL and press Return. Suggestions can be selected with up/down.
fr.ami.HelpToolbarURL:URL bar\nType a URL and press Return. Suggestions can be selected with up/down.
it.ami.HelpToolbarURL:URL bar\nType a URL and press Return. Suggestions can be selected with up/down.
nl.ami.HelpToolbarURL:URL bar\nType a URL and press Return. Suggestions can be selected with up/down.
en.ami.HelpToolbarWebSearch:Web search bar.\nType text and press Return to search using your default search provider.
de.ami.HelpToolbarWebSearch:Websuchleiste.\nText eingeben und Enter drücken um mit der Standardsuchmaschine zu suchen.
fr.ami.HelpToolbarWebSearch:Web search bar.\nType text and press Return to search using your default search provider.
it.ami.HelpToolbarWebSearch:Digita una voce in base al provider scelto e premi invio
nl.ami.HelpToolbarWebSearch:Web search bar.\nType text and press Return to search using your default search provider.
en.ami.HelpToolbarAddTab:Add tab\nLMB: Adds a new blank tab.
de.ami.HelpToolbarAddTab:Tab hinzufügen.
fr.ami.HelpToolbarAddTab:Add tab\nLMB: Adds a new blank tab.
it.ami.HelpToolbarAddTab:Apri una nuova scheda
nl.ami.HelpToolbarAddTab:Add tab\nLMB: Adds a new blank tab.
# Configuration tokens