Lines Matching full:path
52 * @param {string} path - The path of language resources which to be translated.
56 public $t(path: string, params?: any): any {
57 if (typeof path !== 'string') {
58 Log.warn(`Invalid parameter type: The type of 'path' should be string, not ${typeof path}.`);
62 return path;
64 let value = this._getMessage(this.messages, path);
66 return path;
72 value = this._translate(path, value, params);
78 * @param {string} path - The path of language resources which to be translated.
82 public $tc(path: string, count?: number): any {
83 if (typeof path !== 'string') {
84 Log.warn(`Invalid parameter type: The type of 'path' should be string, not ${typeof path}.`);
92 return path;
94 let value = this._getMessage(this.messages, path);
96 return path;
101 value = this._getChoice(count, path, value);
102 value = this._translate(path, value, count);
118 Vm.$t = function(path, params) {
120 return i18n.$t(path, params);
122 Vm.$tc = function(path, count) {
124 return i18n.$tc(path, count);
136 private _getMessage(messages: any[], path: string): any {
138 const value = getValue(path, messages[i]);
146 private _getChoice(count: number, path: string, message: any): any {
150 return path;
155 private _translate(path: string, value: any, params: any): any {
157 return path;