view

Using the LocaleSelector plugin, it is possible to switch between the multiple locales present in this project.

configuration.json

{
    "i18n":
    {
        "enabled": true,
        "default": "en-US",

        "locales":
        [
            {
                "uid": "en-US",
                "name": "English",
                "files":
                [
                    {
                        "key": "project.en-US",
                        "url": "./i18n/en-US/locale.json"
                    }
                ]
            },

            {
                "uid": "fr-FR",
                "name": "French",
                "files":
                [
                    {
                        "key": "project.fr-FR",
                        "url": "./i18n/fr-FR/locale.json"
                    }
                ]
            }
        ]
    },

    "story":
    {
        "uid": "locales-story",
        "name": "Multiple Locales Story",
        "slug": "locales-story",
        "description": "This is a project with multiple locales",
        "default": "scene-0",

        "scenes":
        [
            {
                "uid": "scene-0",
                "name": "First scene",
                "slug": "first-scene",
                "description": "This is the first and only scene",

                "media":
                {
                    "uid": "scene-0-pano-0",
                    "type": "image",

                    "source":
                    {
                        "format": "equi",
                        "url": "01-forest.jpg"
                    }
                }
            }
        ]
    },

    "plugins":
    {
        "prefix": "../../plugins/",

        "engines":
        [
            {
                "uid": "org.forgejs.localeselector",
                "url": "LocaleSelector/"
            },

            {
                "uid": "org.forgejs.simpletext",
                "url": "SimpleText/"
            }
        ],

        "instances":
        [
            {
                "uid": "localeselector",
                "engine": "org.forgejs.localeselector",

                "options":
                {
                    "horizontalCenter": true,
                    "bottom": 30,
                    "flagWidth": 150,
                    "flagHeight": 100,
                    "baseURL": "/images/",
                    "fileName": "flag-LOCALE.gif"
                }
            },

            {
                "uid": "text-welcome",
                "engine": "org.forgejs.simpletext",

                "options":
                {
                    "config":
                    {
                        "i18n": true,
                        "value": "pano-welcome",
                        "fontSize": 50,
                        "color": "white",
                        "textAlign": "center"
                    },

                    "horizontalCenter": true,
                    "bottom": 250
                }
            },

            {
                "uid": "text-instructions",
                "engine": "org.forgejs.simpletext",

                "options":
                {
                    "config":
                    {
                        "i18n": true,
                        "value": "pano-instructions",
                        "fontSize": 30,
                        "color": "white",
                        "textAlign": "center"
                    },

                    "horizontalCenter": true,
                    "bottom": 160
                }
            }
        ]
    }
}

local.json (en-US sample)

{
    "pano-welcome": "Welcome to the forest !",
    "pano-instructions": "Click and drag your mouse to move inside the panorama."
}

Back to samples

3rd Jan 2017