@@ -94,6 +94,8 @@ export default class I18nPlugin extends AdminForthPlugin {
9494
9595 adminforth : IAdminForth ;
9696
97+ externalAppOnly : boolean ;
98+
9799 // sorted by name list of all supported languages, without en e.g. 'al|ro|uk'
98100 fullCompleatedFieldValue : string ;
99101
@@ -140,7 +142,8 @@ export default class I18nPlugin extends AdminForthPlugin {
140142 throw new Error ( `Invalid language code ${ lang } , please define valid ISO 639-1 language code (2 lowercase letters)` ) ;
141143 }
142144 } ) ;
143-
145+
146+ this . externalAppOnly = this . options . externalAppOnly === true ;
144147
145148 // find primary key field
146149 this . primaryKeyFieldName = resourceConfig . columns . find ( c => c . primaryKey ) ?. name ;
@@ -265,20 +268,22 @@ export default class I18nPlugin extends AdminForthPlugin {
265268 ) )
266269 } ;
267270 // add underLogin component
268- ( adminforth . config . customization . loginPageInjections . underInputs ) . push ( {
269- file : this . componentPath ( 'LanguageUnderLogin.vue' ) ,
270- meta : compMeta
271- } ) ;
271+ if ( ! this . externalAppOnly ) {
272+ ( adminforth . config . customization . loginPageInjections . underInputs ) . push ( {
273+ file : this . componentPath ( 'LanguageUnderLogin.vue' ) ,
274+ meta : compMeta
275+ } ) ;
272276
273- ( adminforth . config . customization . globalInjections . userMenu ) . push ( {
274- file : this . componentPath ( 'LanguageInUserMenu.vue' ) ,
275- meta : compMeta
276- } ) ;
277+ ( adminforth . config . customization . globalInjections . userMenu ) . push ( {
278+ file : this . componentPath ( 'LanguageInUserMenu.vue' ) ,
279+ meta : compMeta
280+ } ) ;
277281
278- adminforth . config . customization . globalInjections . everyPageBottom . push ( {
279- file : this . componentPath ( 'LanguageEveryPageLoader.vue' ) ,
280- meta : compMeta
281- } ) ;
282+ adminforth . config . customization . globalInjections . everyPageBottom . push ( {
283+ file : this . componentPath ( 'LanguageEveryPageLoader.vue' ) ,
284+ meta : compMeta
285+ } ) ;
286+ }
282287
283288 // disable create allowedActions for translations
284289 resourceConfig . options . allowedActions . create = false ;
@@ -735,7 +740,9 @@ JSON.stringify(strings.reduce((acc: object, s: { en_string: string }): object =>
735740 }
736741
737742 // in this plugin we will use plugin to fill the database with missing language messages
738- this . tryProcessAndWatch ( adminforth ) ;
743+ if ( ! this . externalAppOnly ) {
744+ this . tryProcessAndWatch ( adminforth ) ;
745+ }
739746
740747 adminforth . tr = async ( msg : string | null | undefined , category : string , lang : string , params , pluralizationNumber : number ) : Promise < string > => {
741748 if ( ! msg ) {
0 commit comments