Skip to content

Extension.json #148

@tinganho

Description

@tinganho

L10ns will load extensions by parsing a package.json file.

Extensions will be installed in /usr/local/lib/l10ns/extensions on unix computers and whatever equivalent on Windows computers. All projects share the same version of an extension.

The extension.json files will primarily have this configuration fields:

{
    "Name": "TypeScript",
    "FileExtensions": ["ts", "tsx"],
    "Capabilities": [
        "Plural", 
        "Select",
        "Date",
        "Number"
    ],
    "DependencyTest": "bin/dep-test",
    "Execute": "node bin/l10ns-ts.js",
    "Test": {
        "CaseDirectory": "Tests/Cases/",
        "CurrentDirectory": "Tests/Current",
        "ReferenceDirectory": "Tests/References",
    }
}

Developers will have the following command to test:

l10ns ext-test

Name

Name of the extension.

FileExtensions

File extensions of the programming language. This file extensions will be used for searching for files to extract localization keys.

Capabilities

Specify which capabilities your extension has. Capabilities is here referring to formatting capabilites. To ease extension developers from developing all capabilities, which is quite a tall order. We will provide an opt-in capability to the following capabilities:

  • Interpolation
  • PluralFormat
  • SelectFormat
  • OrdinalFormat
  • NumberFormat
  • CurrencyFormat
  • DateFormat

DependencyTest

Extensions might depend on its environment to work properly, like requiring a specific runtime or a dynamic library. DependencyTest tests the environment if all dependency requirements are met. It should also give specific feedback on unmet requirements. through IPC communication.

Execute

The extension executable.

Test

Extension developers should use the provided testing infrastructure form L10ns. It prvoides document testing, which requires that you specify a case, reference, current directory.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions