hummingbird-me/kitsu-web

View on GitHub
app/helpers/category-to-i18n.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { helper } from '@ember/component/helper';

export function categoryToI18n([str = '']) {
  if (str === '') return 'titles.not-found';
  const string = str.replace(/(\.|\!)/, '').toLowerCase();
  return `category.${string}`;
}

export default helper(categoryToI18n);