@maxgraph/core
    Preparing search index...

    Interface I18nProviderExperimental

    The abstract interface for the I18n system. The actual implementation is configured in GlobalConfig.i18n.

    subject to change or removal. The I18n system may be modified in the future without prior notice.

    0.17.0

    interface I18nProvider {
        addResource(
            basename?: null | string,
            language?: null | string,
            callback?: null | Function,
        ): void;
        get(
            key?: null | string,
            params?: null | any[],
            defaultValue?: null | string,
        ): null | string;
        isEnabled(): boolean;
    }

    Implemented by

    Index

    Methods

    • Experimental

      Load the translation file for the given basename and language.

      This is mainly used by the maxGraph built-in provider to bind to Translations.add.

      Parameters

      • Optionalbasename: null | string

        The basename for which the file should be loaded.

      • Optionallanguage: null | string

        The language for which the file should be loaded. Default is null.

      • Optionalcallback: null | Function

        Optional callback for asynchronous loading. Default is null.

      Returns void

    • Experimental

      Returns the value for the specified resource key.

      Parameters

      • Optionalkey: null | string

        String that represents the key of the resource to be returned.

      • Optionalparams: null | any[]

        Array of the values for the placeholders to be replaced with in the resulting string. The form of the placeholder is specific to each implementation.

      • OptionaldefaultValue: null | string

        Optional string that specifies the default return value.

      Returns null | string

    • Experimental

      Returns whether internationalization is enabled.

      Returns boolean