Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const setupLocale = ( locale, extraTranslations ) => {
I18nManager.forceRTL( false ); // Change to `true` to debug RTL layout easily.
let gutenbergTranslations = getTranslation( locale );
if ( locale && ! gutenbergTranslations ) {
// Try stripping out the regional
locale = locale.replace( /[-_][A-Za-z]+$/, '' );
gutenbergTranslations = getTranslation( locale );
}
const translations = Object.assign( {}, gutenbergTranslations, extraTranslations );
// eslint-disable-next-line no-console
console.log( 'locale', locale, translations );
// Only change the locale if it's supported by gutenberg
if ( gutenbergTranslations || extraTranslations ) {
setLocaleData( translations );
}
};
const setupLocale = ( locale, extraTranslations ) => {
I18nManager.forceRTL( false ); // Change to `true` to debug RTL layout easily.
let gutenbergTranslations = getTranslation( locale );
if ( locale && ! gutenbergTranslations ) {
// Try stripping out the regional
locale = locale.replace( /[-_][A-Za-z]+$/, '' );
gutenbergTranslations = getTranslation( locale );
}
const translations = Object.assign( {}, gutenbergTranslations, extraTranslations );
// eslint-disable-next-line no-console
console.log( 'locale', locale, translations );
// Only change the locale if it's supported by gutenberg
if ( gutenbergTranslations || extraTranslations ) {
setLocaleData( translations );
}
};
constructor( props ) {
super( props );
this.state = {
hasError: false,
};
// Set up translations.
setLocaleData( googlesitekit.locale, 'google-site-kit' );
}
constructor( props ) {
super( props );
this.state = { hasError: false };
// Set up translations.
setLocaleData( googlesitekit.locale, 'google-site-kit' );
const {
showModuleSetupWizard,
} = googlesitekit.setup;
this.state = {
showModuleSetupWizard,
};
}
constructor( props ) {
super( props );
this.state = { hasError: false };
// Set up translations.
setLocaleData( googlesitekit.locale, 'google-site-kit' );
}
export function setTextdomainL10n( textdomain, l10nNamespace = "wpseoYoastJSL10n" ) {
const translations = get( window, [ l10nNamespace, textdomain, "locale_data", textdomain ], false );
if ( translations === false ) {
// Jed needs to have meta information in the object keyed by an empty string.
setLocaleData( { "": {} }, textdomain );
} else {
setLocaleData( translations, textdomain );
}
}
constructor( props ) {
super( props );
// Set up translations.
setLocaleData( googlesitekit.locale, 'google-site-kit' );
this.handleMoreDetailsLink = this.handleMoreDetailsLink.bind( this );
}
constructor( props ) {
super( props );
this.state = {
hasError: false,
};
// Set up translations.
setLocaleData( googlesitekit.locale, 'google-site-kit' );
}
export function setTextdomainL10n( textdomain, l10nNamespace = "wpseoYoastJSL10n" ) {
const translations = get( window, [ l10nNamespace, textdomain, "locale_data", textdomain ], false );
if ( translations === false ) {
// Jed needs to have meta information in the object keyed by an empty string.
setLocaleData( { "": {} }, textdomain );
} else {
setLocaleData( translations, textdomain );
}
}
window.acct_add_locale = function(name, localeData) {
setLocaleData(localeData, name);
};