File: tools.js

package info (click to toggle)
xnote 4.6.51-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 960 kB
  • sloc: javascript: 7,147; makefile: 22; sh: 9
file content (12 lines) | stat: -rw-r--r-- 305 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
function translateURL(url, anchor) {
    if (typeof (anchor) == 'undefined') anchor = '';

    // Skip translation if a absolute path is given.
    let rv = url.startsWith("/")
      ? null
      : browser.i18n.getMessage(url);

    return rv
        ? rv + anchor
        : url + anchor;
  }