Giter Site home page Giter Site logo

liondocs-sublime's People

Contributors

actions-user avatar graywolf9 avatar jalkhov avatar juanvqz avatar

Forkers

graywolf9

liondocs-sublime's Issues

Idea - Patterns for replacement

Hi there :)

I'm no Sublime Text user but one thing that I often use while working on updates/new translations is https://marketplace.visualstudio.com/items?itemName=bhughes339.replacerules to replace patterns.
This helps consistently and effortlessly translating "standard" headers (like "See also", "Browser compatibility" etc.

I also use this one to replace "xref"-macros (though I don't properly deal with some edge cases at the moment).

Here is the current list of regexp/patterns (in French of course ^^):

"replacerules.rules": {
    "domxref-1-simple":{
        "find": "\\{\\{domxref\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Web/API/$1\"><code>$1</code></a>",
        "flags": "gmi"
    },
    "domxref-1-prop":{
        "find": "\\{\\{domxref\\(['\"]([^,.'\"]*?)\\.([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Web/API/$1/$2\"><code>$1.$2</code></a>",
        "flags": "gmi"
    },
    "domxref-2-prop":{
        "find": "\\{\\{domxref\\(['\"]([^,.'\"]*?)\\.([^,.'\"]*?)['\"],[ ]?['\"]([^\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Web/API/$1/$2\"><code>$3</code></a>",
        "flags": "gmi"
    },
    "domxref-4-no-prop":{
        "find": "\\{\\{domxref\\(['\"]([^,.'\"]*?)['\"],[ ]?['\"]([^\"]*?)['\"],[ ]?['\"]['\"],[ ]?1\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Web/API/$1\">$2</a>",
        "flags": "gmi"
    },
    "domxref-4-prop":{
        "find": "\\{\\{domxref\\(['\"]([^,.'\"]*?)\\.([^,.'\"]*?)['\"],[ ]?['\"]([^\"]*?)['\"],[ ]?['\"]['\"],[ ]?1\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Web/API/$1/$2\">$3</a>",
        "flags": "gmi"
    },
    "http-header":{
        "find": "\\{\\{HTTPHeader\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Web/HTTP/Headers/$1\"><code>$1</code></a>",
        "flags": "gmi"
    },
    "http-method":{
        "find": "\\{\\{HTTPMethod\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Web/HTTP/Methods/$1\"><code>$1</code></a>",
        "flags": "gmi"
    },
    "http-status":{
        "find": "\\{\\{HTTPStatus\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Web/HTTP/Status/$1\"><code>$1</code></a>",
        "flags": "gmi"
    },
    "glossary-1":{
        "find": "\\{\\{Glossary\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Glossary/$1\">$1</a>",
        "flags": "gmi"
    },
    "glossary-2":{
        "find": "\\{\\{Glossary\\(['\"]([^,.'\"]*?)['\"],[ ]?['\"]([^\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Glossary/$1\">$2</a>",
        "flags": "gmi"
    },
    "htmlattrxref-1":{
        "find": "\\{\\{htmlattrxref\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace":"<a href=\"/fr/docs/Web/HTML/Global_attributes#$1\"><code>$1</code></a>",
        "flags": "gmi"
    },
    "htmlattrxref-2":{
        "find": "\\{\\{htmlattrxref\\(['\"]([^,.'\"]*?)['\"],[ ]?['\"]([^\"]*?)['\"]\\)\\}\\}",
        "replace":"<a href=\"/fr/docs/Web/HTML/Element/$2#attr-$1\"><code>$1</code></a>",
        "flags": "gmi"
    },
    "htmlattrxref-3":{
        "find": "\\{\\{htmlattrxref\\(['\"]([^,.'\"]*?)['\"],[ ]?['\"]([^\"]*?)['\"],[ ]?['\"]([^\"]*?)['\"]\\)\\}\\}",
        "replace":"<a href=\"/fr/docs/Web/HTML/Element/$2#attr-$1\"><code>$3</code></a>",
        "flags": "gmi"
    },
    "cssxref-1":{
        "find": "\\{\\{cssxref\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace":"<a href=\"/fr/docs/Web/CSS/$1\"><code>$1</code></a>",
        "flags": "gmi"
    },
    "htmlelement-1":{
        "find": "\\{\\{htmlelement\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace":"<a href=\"/fr/docs/Web/HTML/Element/$1\"><code>&lt;$1&gt;</code></a>",
        "flags": "gmi"
    },
    "event-1":{
        "find": "\\{\\{event\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Web/API/Document/$1_event\"><code>$1</code></a>",
        "flags": "gmi"
    },
    "jsxref-2-proto":{
        "find": "\\{\\{jsxref\\(['\"]([^,.'\"]*?)\\.prototype\\.([^,.'\"]*?)['\"],[ ]?['\"]([^\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Web/JavaScript/Reference/Global_Objects/$1/$2\"><code>$3</code></a>",
        "flags": "gmi"
    },
    "jsxref-1-proto":{
        "find": "\\{\\{jsxref\\(['\"]([^,.'\"]*?)\\.prototype\\.([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Web/JavaScript/Reference/Global_Objects/$1/$2\"><code>$1.prototype.$2</code></a>",
        "flags": "gmi"
    },
    "jsxref-2-childpage":{
        "find": "\\{\\{jsxref\\(['\"]([^,.'\"]*?)\/([^,.'\"]*?)['\"],[ ]?['\"]([^\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Web/JavaScript/Reference/$1/$2\"><code>$3</code></a>",
        "flags": "gmi"
    },
    "jsxref-1":{
        "find": "\\{\\{jsxref\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Web/JavaScript/Reference/Global_Objects/$1\"><code>$1</code></a>",
        "flags": "gmi"
    },
    "SVGElement-1":{
        "find": "\\{\\{SVGElement\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Web/SVG/Element/$1\"><code>&lt;$1&gt;</code></a>",
        "flags": "gmi"
    },
    "SVGAttr-1":{
        "find": "\\{\\{SVGAttr\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"/fr/docs/Web/SVG/Attribute/$1\"><code>$1</code></a>",
        "flags": "gmi"
    },
    "bug-1":{
        "find": "\\{\\{bug\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=$1\">bug $1</a>",
        "flags": "gmi"
        
    },
    "ARIARole-1":{
        "find": "\\{\\{ARIARole\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "<a href=\"https://w3c.github.io/aria/#$1\"><code>$1</code></a>",
        "flags": "gmi"
    },
    "htmlattrdef-1":{
        "find": "\\{\\{htmlattrdef\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "<strong id=\"attr-$1\"><code>$1</code></strong>",
        "flags": "gmi"
    },
    "md-jsxref-2-proto":{
        "find": "\\{\\{jsxref\\(['\"]([^,.'\"]*?)\\.prototype\\.([^,.'\"]*?)['\"],[ ]?['\"]([^\"]*?)['\"]\\)\\}\\}",
        "replace": "[`$3`](/fr/docs/Web/JavaScript/Reference/Global_Objects/$1/$2)",
        "flags": "gmi"
    },
    "md-jsxref-1-proto":{
        "find": "\\{\\{jsxref\\(['\"]([^,.'\"]*?)\\.prototype\\.([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "[`$1.prototype.$2`](/fr/docs/Web/JavaScript/Reference/Global_Objects/$1/$2)",
        "flags": "gmi"
    },
    "md-jsxref-1-prop":{
        "find": "\\{\\{jsxref\\(['\"]([^,.'\"]*?)\\.([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "[`$1.$2`](/fr/docs/Web/JavaScript/Reference/Global_Objects/$1/$2)",
        "flags": "gmi"
    },
    "md-jsxref-2-prop":{
        "find": "\\{\\{jsxref\\(['\"]([^,.'\"]*?)\\.([^,.'\"]*?)['\"],[ ]?['\"]([^\"]*?)['\"]\\)\\}\\}",
        "replace": "[`$3`](/fr/docs/Web/JavaScript/Reference/Global_Objects/$1/$2)",
        "flags": "gmi"
    },
    "md-jsxref-2-childpage":{
        "find": "\\{\\{jsxref\\(['\"]([^,.'\"]*?)\/([^,.'\"]*?)['\"],[ ]?['\"]([^\"]*?)['\"]\\)\\}\\}",
        "replace": "[`$3`](/fr/docs/Web/JavaScript/Reference/$1/$2)",
        "flags": "gmi"
    },
    "md-jsxref-1":{
        "find": "\\{\\{jsxref\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "[`$1`](/fr/docs/Web/JavaScript/Reference/Global_Objects/$1)",
        "flags": "gmi"
    },
    "md-domxref-1-simple":{
        "find": "\\{\\{domxref\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "[`$1`](/fr/docs/Web/API/$1)",
        "flags": "gmi"
    },
    "md-domxref-1-prop":{
        "find": "\\{\\{domxref\\(['\"]([^,.'\"]*?)\\.([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace": "[`$1.$2`](/fr/docs/Web/API/$1/$2)",
        "flags": "gmi"
    },
    "md-domxref-2-prop":{
        "find": "\\{\\{domxref\\(['\"]([^,.'\"]*?)\\.([^,.'\"]*?)['\"],[ ]?['\"]([^\"]*?)['\"]\\)\\}\\}",
        "replace": "[`$3`](/fr/docs/Web/API/$1/$2)",
        "flags": "gmi"
    },
    "md-domxref-4-no-prop":{
        "find": "\\{\\{domxref\\(['\"]([^,.'\"]*?)['\"],[ ]?['\"]([^\"]*?)['\"],[ ]?['\"]['\"],[ ]?1\\)\\}\\}",
        "replace": "[`$2`](/fr/docs/Web/API/$1)",
        "flags": "gmi"
    },
    "md-domxref-4-prop":{
        "find": "\\{\\{domxref\\(['\"]([^,.'\"]*?)\\.([^,.'\"]*?)['\"],[ ]?['\"]([^\"]*?)['\"],[ ]?['\"]['\"],[ ]?1\\)\\}\\}",
        "replace": "[`$3`](/fr/docs/Web/API/$1/$2)",
        "flags": "gmi"
    },
    "md-cssxref-1":{
        "find": "\\{\\{cssxref\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace":"[`$1`](/fr/docs/Web/CSS/$1)",
        "flags": "gmi"
    },
    "md-htmlelement-1":{
        "find": "\\{\\{htmlelement\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
        "replace":"[`<$1>`](/fr/docs/Web/HTML/Element/$1)",
        "flags": "gmi"
    },
    "md-heading-example":{
        "find": "## Examples",
        "replace":"## Exemples",
        "flags": "gmi"
    },
    "md-heading-browser-compat":{
        "find": "## Browser compatibility",
        "replace":"## Compatibilité des navigateurs",
        "flags": "gmi"
    },
    "md-heading-spec":{
        "find": "## Specifications",
        "replace":"## Spécifications",
        "flags": "gmi"
    },
    "md-heading-see-also":{
        "find": "## See also",
        "replace":"## Voir aussi",
        "flags": "gmi"
    },
    "md-heading-param":{
        "find": "## Parameters",
        "replace":"## Paramètres",
        "flags": "gmi"
    },
    "md-heading-return":{
        "find": "## Return value",
        "replace":"## Valeur de retour",
        "flags": "gmi"
    },
    "md-httpheader-1":{
        "find": "\\{\\{httpheader\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
            "replace":"[`$1`](/fr/docs/Web/HTTP/Headers/$1)",
            "flags": "gmi"
    },
    "md-svgattr-1":{
        "find": "\\{\\{svgattr\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
            "replace":"[`$1`](/fr/docs/Web/SVG/Attribute/$1)",
            "flags": "gmi"
    },
    "md-svgelement-1":{
        "find": "\\{\\{svgelement\\(['\"]([^,.'\"]*?)['\"]\\)\\}\\}",
            "replace":"[`<$1>`](/fr/docs/Web/SVG/Element/$1)",
            "flags": "gmi"
    },
  }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.