add composable wrapper for phrasen mixin

This commit is contained in:
Werner Masik
2023-09-26 11:58:58 +02:00
parent f5bbc8a0c0
commit 822e269f88
+18
View File
@@ -44,6 +44,24 @@ function getValueForLoadedPhrase(category, phrase, params) {
return result;
}
// Composable (wrapper for mixin)
export function usePhrasen() {
function t_ref(category, phrase, params) {
return phrasen.t_ref(category, phrase, params);
}
function t(category, phrase, params) {
return phrasen.t(category, phrase, params);
}
return {
t_ref,
t,
}
}
const phrasen = {
t_ref(category, phrase, params) {
if (params === undefined && (