/**
 * Program: Mixin for Multilingual Processing
 * Author: SDL
 * Description: Mixin for Multilingual Processing
 */
import { mapGetters } from 'vuex';

export default {
  computed: {
    ...mapGetters({
      locale: 'getLocale',
    }),
  },
  methods: {
    getLabel({ labelJson, label }) {
      try {
        if (labelJson && labelJson[this.locale] !== undefined && labelJson[this.locale].trim() !== '') {
          return labelJson[this.locale];
        }
        return label;
      } catch (e) {
        return label;
      }
    },
  },
};
