[Geomoose-users] Geomoose services language change

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Geomoose-users] Geomoose services language change

Laraper
I would like to change the language of the pop-up services. Specially "print" and "search" services....I've allready changed the toolbar tabs language...but I don't find the source files where change the label language of the services. I've found the services print and serach under the folders "idst" and "src" under the geomoose folder....which one do I have to vhange? or none of those ones? Thanks.

--

Cap del Departament de Cartografia i Topografia
Lara Perez Bessone
Enginyera Tecnica Topografa Municipal
email: [hidden email] Tel. mòvil: 647 835 086 ext. 521


Ajuntament d'Oliva - València
Plaça del Ajuntament 1, 46780 Oliva
Tel. 962850250 Fax 962855165 www.oliva.es

_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users
Reply | Threaded
Open this post in threaded view
|

Re: [Geomoose-users] Geomoose services language change

chughes
I'm assuming you're trying to do this in GeoMoose 3.

For search, my best guess would be in dist/services/search.js.
You do have some ability to override the labels in your app.js file without having to modify the source files.

For example, I've changed the default title of the search tool, as well as the results, when I declared my search service:

        app.registerService('search-Taxlots-simple', SearchService, {
            // The input fields are defined only using one field
            title: 'Simple Taxlot Search',
            resultsTitle: 'Taxlots Search Results',
            fields: [
                {type: 'text', label: 'Simple Search', name: 'TERM'},
            ],
            prepareFields: function (fields) {
                // this pulls out the term from the search
                const searchTerm = fields[0].value;
                // this is the list of fields in the layer which will be searched.
                const searchFields = ['OwnName', 'SitusAll', 'ParcelID', 'PropertyId', 'Address1'];
                // this switched to matching any field
                var query = ['or'];
                for(var i = 0, ii = searchFields.length; i < ii; i++) {
                    query.push({
                        comparitor: 'ilike',
                        name: searchFields[i],
                        value: '%' + searchTerm + '%'
                    });
                }
                return [query];
            },
            searchLayers: ['Taxlots_selection-wfs/Taxlots_selection'],
            validateFieldValues: function (fields) {
                let nonEmpty = 0;
                const validateFieldValuesResult = {
                    valid: true,
                    message: null
                };

                if (fields['TERM'] !== undefined && fields['TERM'] !== '') {
                        nonEmpty++;
                }

                if (nonEmpty === 0) {
                    validateFieldValuesResult.valid = false;
                    validateFieldValuesResult.message = 'Please complete at least one field.'
                }
                return validateFieldValuesResult;
            }
        });



Hope this helps,

Chris








On Tue, Apr 28, 2020 at 10:37 AM <[hidden email]> wrote:
I would like to change the language of the pop-up services. Specially "print" and "search" services....I've allready changed the toolbar tabs language...but I don't find the source files where change the label language of the services. I've found the services print and serach under the folders "idst" and "src" under the geomoose folder....which one do I have to vhange? or none of those ones? Thanks.

--

Cap del Departament de Cartografia i Topografia
Lara Perez Bessone
Enginyera Tecnica Topografa Municipal
email: [hidden email] Tel. mòvil: 647 835 086 ext. 521


Ajuntament d'Oliva - València
Plaça del Ajuntament 1, 46780 Oliva
Tel. 962850250 Fax 962855165 www.oliva.es
_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users


--
Chris Hughes

GIS Analyst
Lincoln County Surveyor Department 
880 NE 7th St. l Newport, OR 97365
Tel: (541) 574 1283

_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users
Reply | Threaded
Open this post in threaded view
|

Re: [Geomoose-users] Geomoose services language change

Dan Little-2
Translation has been a big missing feature in the 3.X series.

That said, I spent some time tonight to start tackling it. I would say by the end of the weekend this pull request should be ready for review:

As noted in the pull request, the Spanish translation is very poor. Even with my limited Spanish skills I can tell some things are really really bad but it was a blind submission to Google Translate. For what it's worth, the German translation was also hilariously bad.

On Tue, Apr 28, 2020 at 1:38 PM Christopher Hughes <[hidden email]> wrote:
I'm assuming you're trying to do this in GeoMoose 3.

For search, my best guess would be in dist/services/search.js.
You do have some ability to override the labels in your app.js file without having to modify the source files.

For example, I've changed the default title of the search tool, as well as the results, when I declared my search service:

        app.registerService('search-Taxlots-simple', SearchService, {
            // The input fields are defined only using one field
            title: 'Simple Taxlot Search',
            resultsTitle: 'Taxlots Search Results',
            fields: [
                {type: 'text', label: 'Simple Search', name: 'TERM'},
            ],
            prepareFields: function (fields) {
                // this pulls out the term from the search
                const searchTerm = fields[0].value;
                // this is the list of fields in the layer which will be searched.
                const searchFields = ['OwnName', 'SitusAll', 'ParcelID', 'PropertyId', 'Address1'];
                // this switched to matching any field
                var query = ['or'];
                for(var i = 0, ii = searchFields.length; i < ii; i++) {
                    query.push({
                        comparitor: 'ilike',
                        name: searchFields[i],
                        value: '%' + searchTerm + '%'
                    });
                }
                return [query];
            },
            searchLayers: ['Taxlots_selection-wfs/Taxlots_selection'],
            validateFieldValues: function (fields) {
                let nonEmpty = 0;
                const validateFieldValuesResult = {
                    valid: true,
                    message: null
                };

                if (fields['TERM'] !== undefined && fields['TERM'] !== '') {
                        nonEmpty++;
                }

                if (nonEmpty === 0) {
                    validateFieldValuesResult.valid = false;
                    validateFieldValuesResult.message = 'Please complete at least one field.'
                }
                return validateFieldValuesResult;
            }
        });



Hope this helps,

Chris








On Tue, Apr 28, 2020 at 10:37 AM <[hidden email]> wrote:
I would like to change the language of the pop-up services. Specially "print" and "search" services....I've allready changed the toolbar tabs language...but I don't find the source files where change the label language of the services. I've found the services print and serach under the folders "idst" and "src" under the geomoose folder....which one do I have to vhange? or none of those ones? Thanks.

--

Cap del Departament de Cartografia i Topografia
Lara Perez Bessone
Enginyera Tecnica Topografa Municipal
email: [hidden email] Tel. mòvil: 647 835 086 ext. 521


Ajuntament d'Oliva - València
Plaça del Ajuntament 1, 46780 Oliva
Tel. 962850250 Fax 962855165 www.oliva.es
_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users


--
Chris Hughes

GIS Analyst
Lincoln County Surveyor Department 
880 NE 7th St. l Newport, OR 97365
Tel: (541) 574 1283
_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users

_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users