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:
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.
L10ns will load extensions by parsing a
package.jsonfile.Extensions will be installed in
/usr/local/lib/l10ns/extensionson unix computers and whatever equivalent on Windows computers. All projects share the same version of an extension.The
extension.jsonfiles 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:
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:
DependencyTest
Extensions might depend on its environment to work properly, like requiring a specific runtime or a dynamic library.
DependencyTesttests 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,currentdirectory.