Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom logging missing translation with Unit tests #281

Closed

Conversation

DServy
Copy link

@DServy DServy commented Oct 27, 2016

Updates for Missing Translations, adds a passthrough that a user can run a function hook to do something with the missing function. Already proven super helpful for some logging stuff we need to do. In theory can be used with a Zanata instance to automatically add in missing translations. Possibilities are huge.

example usage:

missingTranslation: function(locale, value){
        value = value.replace('\n', ' ');
        console.log("app='%s' type='MissingTranslation' language='%s' string='%s'", process.env.HEROKU_APP_NAME, locale, value);
    }

Updates to make pull #233 unit tests work for @farfromrefug. Fixed merge conflicts, making the unit test pass

DServy added 3 commits May 2, 2016 11:11
Updates for Missing Translations, adds a passthrough that a user can
run a function hook to do something with the missing function
Adding in Unit Test Coverage for Missing Translation Function
@coveralls
Copy link

coveralls commented Oct 27, 2016

Coverage Status

Coverage increased (+0.02%) to 97.925% when pulling 48e7afb on DServy:custom-logging-missing-translation into 11d89da on mashpie:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 97.925% when pulling 48e7afb on DServy:custom-logging-missing-translation into 11d89da on mashpie:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 97.925% when pulling 48e7afb on DServy:custom-logging-missing-translation into 11d89da on mashpie:master.

@njroussel
Copy link

This is really necessary ! Can we get a new version published once this is merged ?

@mashpie
Copy link
Owner

mashpie commented Aug 15, 2020

now there is generic config option to setup your own callback function:

    // used to alter the behaviour of missing keys
    missingKeyFn: function (locale, value) {
        return value;
    },

you may add logging, return custom values or anything.

@mashpie mashpie closed this Aug 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants