nodebox / live

Report issues with NodeBox Live
1 stars 0 forks source link

internationalization / localization #39

Open craftoid opened 7 years ago

craftoid commented 7 years ago

We want to use nodebox.live for teaching teaching kids to code. Since the kinds don't speak English, internationalization is an important issue for us.

It seems all the reference is included from https://github.com/nodebox/g.js/tree/gh-pages/ref Is this correct?

What would be the best way to create a German language version of nodebox.live?

I figured out how to create and include an alternative version of core/g. My current approach would be to fork the g.js docs, translate them to German and write a script to includes the German translation into my custom version of the core/g...

screenshot

localization

project


{
    "title": "localization test 01",
    "color": "teal",
    "dependencies": {
        "bitcraftlab/gDE": "dev"
    },
    "assets": {},
    "functions": [
        {
            "name": "hauptprogramm",
            "type": "network",
            "renderedNode": "rechteck1",
            "nodes": [
                {
                    "name": "rechteck1",
                    "x": 65,
                    "y": 55,
                    "fn": "g_de.rechteck"
                }
            ],
            "connections": [],
            "parameters": [],
            "returnsList": true
        }
    ],
    "id": "germanTest01"
}

g_de

{
    "id": "g_de",
    "title": "Grafik",
    "dependencies": {},
    "functions": [
        {
            "name": "rechteck",
            "type": "code",
            "outputType": "shape",
            "parameters": [
                {
                    "name": "position",
                    "type": "point",
                    "value": {
                        "x": 0,
                        "y": 0
                    }
                },
                {
                    "name": "breite",
                    "type": "float",
                    "value": 100
                },
                {
                    "name": "hoehe",
                    "type": "float",
                    "value": 100
                },
                {
                    "name": "rundung",
                    "type": "float",
                    "value": 0
                }
            ],
            "ref": "Erzeuge ein Rechteck oder ein Quadrat.\n\n    g.rect({x: 0, y: 0}, 100, 100);\n\nMit dem vierten Parameter kann man optional die Rundheit der Ecken kontrollieren:\n\n    g.rect({x: 0, y: 0}, 100, 100, 10);\n\n## Parameters\n- `position`: Mittelpunkt des Rechtecks.\n- `breite`: Breite des Rechtecks.\n- `hoehe`: Höhe des Rechtecks.\n- `rundung`: Rundheit der Ecken.\n\n## Siehe auch\n- [Vektor Grafik](guide:vector-graphics)\n",
            "source": "g_de.rechteck = g.rect;"
        }
    ]
}
craftoid commented 7 years ago

Oh! I just realized that the reference for gjs.org seems to be generated from nodebox.live, not vice versa >>> https://github.com/nodebox/g.js/blob/gh-pages/scripts/nbl-to-ref.js I think this little node.js script could be a good starting point for a localization script ...