<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">JSEA</journal-id><journal-title-group><journal-title>Journal of Software Engineering and Applications</journal-title></journal-title-group><issn pub-type="epub">1945-3116</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jsea.2018.1111033</article-id><article-id pub-id-type="publisher-id">JSEA-88902</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject></subj-group></article-categories><title-group><article-title>
 
 
  A Grammatical Approach of Multi-Localization of GUIs: Application to the Multi-Localization of the Checkers Game GUI
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Maurice</surname><given-names>Tchoupé Tchendji</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Freddy-Viany</surname><given-names>Tatou Ahoukeng</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>Department of Mathematics and Computer Science, Faculty of Sciences, University of Dschang, Dschang, Cameroon</addr-line></aff><pub-date pub-type="epub"><day>26</day><month>11</month><year>2018</year></pub-date><volume>11</volume><issue>11</issue><fpage>552</fpage><lpage>567</lpage><history><date date-type="received"><day>23,</day>	<month>October</month>	<year>2018</year></date><date date-type="rev-recd"><day>27,</day>	<month>November</month>	<year>2018</year>	</date><date date-type="accepted"><day>30,</day>	<month>November</month>	<year>2018</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  By proposing tools that help for the accomplishment of tasks in almost all sectors of activities, computer science has revolutionized the world in a general way. Nowadays, it addresses the peculiarities of peoples through their culture in order to produce increasingly easy-to-use software for end users: This is the aim of software localization. Localizing a software consists among other things, in adapting its GUI according to the end user culture. We propose in this paper a generic approach allowing accomplishing this adaptation, even for multi-user applications like gaming applications, collaborative editors, etc. Techniques of functional interpretations of abstracts structures parameterized by algebras, constitute the formal base of our approach.
 
</p></abstract><kwd-group><kwd>GUIs</kwd><kwd> Context-Free Grammars</kwd><kwd> Multi-Localization</kwd><kwd> Abstract Syntax Tree and Its Interpretations</kwd><kwd> XML</kwd><kwd> GUI Description Language</kwd><kwd> Haskell</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Regarded as the fourth pillar for sustainable development [<xref ref-type="bibr" rid="scirp.88902-ref1">1</xref>] , according to the UNESCO<sup>1</sup> Convention on the Protection and Promotion of the Diversity of Cultural Expressions, cultural diversity is a “world heritage” [<xref ref-type="bibr" rid="scirp.88902-ref2">2</xref>] and constitutes a great wealth for the people. Therefore, the protection, promotion and maintenance of cultural diversity are essentials for sustainable development for the benefit of present and future generations. Moreover, as far as computer science is concerns, one can easily agree that, a given user (a human), will use much more intuitively a software if he finds in the latter, elements that are culturally close to him as language, iconography, and the color palette used, etc.</p><p>From the observations above, it is clear that it is imperative to take into account the various aspects related to cultural diversity during the development of a software. This is not only to ensure that it is built in respect of the culture of its various end users, but also to produce increasingly easy-to-use software for end users. In order to achieve these objectives, cultural computing<sup>2</sup> is the paradigm that should be used if we want to efficiently take into account the possible cultural diversity of end users, when producing a software tool. With this in mind, software publishers, are now using knowledge from cultural computing to improve the user’s experience of each of the end users of their tools: The tool must be constructed in such a way that it is the GUI (Graphical User Interface) that adapts to the user and not the other way around.</p><p>In order to produce several (localized) versions of the same software product, publishers use two techniques: internationalization (i18n) and localization (l10n) [<xref ref-type="bibr" rid="scirp.88902-ref4">4</xref>] [<xref ref-type="bibr" rid="scirp.88902-ref5">5</xref>] . Internationalization is the process of generalization which, in software design, allows abstracting it from the peculiarities of a given culture by representing intentionally the objects which it manipulates. According to Sch&#228;ler [<xref ref-type="bibr" rid="scirp.88902-ref6">6</xref>] , localisation is “the linguistic and cultural adaptation of digital content to the requirements and locale of a foreign market, and the provision of services and technologies for the management of multilingualism across the digital global information flow”.</p><p>In order to perform a linguistic and cultural adaptation of an application, among other activities, its GUIs must be translated to the signifiers, the habits, etc of targets cultures. <xref ref-type="fig" rid="fig1">Figure 1</xref> presents two located examples of George Weah’s bibliography in Wikipedia for Francophone culture<sup>3</sup> (<xref ref-type="fig" rid="fig1">Figure 1</xref>(a)) and for Arab culture<sup>4</sup> (<xref ref-type="fig" rid="fig1">Figure 1</xref>(b)). On these figures, we can notice some differences concerning the language used, the position of images and menus, colors, etc.</p><p>Most single-user software used around the world are not located. It’s even worse when you consider the case of those running on a network<sup>5</sup>, because for such applications, it might be ideal to offer to each application user at a given time, a GUI who is consistent with its own culture. For example, it’s about designing a multiplayer game or a collaborative editing application so that, each participant interacts on a located GUI in their culture. This is what we call</p><p>multi-localization or simultaneous localization and this is what constitutes the main objective of this paper: to propose a new approach of external multi-localization of GUIs of collaborative and interactive software.</p><p>Starting from the observation that the tree structure of a GUI can be represented intentionally by an abstract syntax tree (AST) for a given context-free grammar (see Section 2.1), we borrow techniques and tools from the domains of language theory, compilation, and functional programming, to show that, a particular localization of a GUI represented intentionally by an AST, is in fact only a particular interpretation of this AST according to a given algebra: this is the formal base on which our multi-localization approach is based.</p><p>More precisely, from an abstract grammar (AST’s model of GUIs of a given application), we deduce: 1) Haskell data types<sup>6</sup> [<xref ref-type="bibr" rid="scirp.88902-ref7">7</xref>] [<xref ref-type="bibr" rid="scirp.88902-ref8">8</xref>] for each of its grammatical symbols, 2) types for algebras that will be use to write as many interpreters as wanted, in as many GUI description languages (FXML<sup>7</sup> [<xref ref-type="bibr" rid="scirp.88902-ref9">9</xref>] , UIML [<xref ref-type="bibr" rid="scirp.88902-ref10">10</xref>] , etc.), 3) evaluation functions, each parameterized by both an algebra and a localization file which will make it possible to locate the AST by interpretation. A synoptic view of the proposed approach is sketched in <xref ref-type="fig" rid="fig2">Figure 2</xref>.</p><p>Organization of the manuscript: Section 2 introduces some concepts related to software localization and GUI modeling using context-free grammars (CFG). Our multi-localization approach, followed by its experimentation (derivation of multi-located GUIs for a network checkers game) is presented in Section 3, while Section 4 is devoted to the conclusion.</p></sec><sec id="s2"><title>2. Preliminaries</title><sec id="s2_1"><title>2.1. Context-Free Grammars as GUI’s Models</title><p>A graphical window (GUI) consists of a set of basic components<sup>8</sup> (Image, Menu, Table, Text Box, etc.), arranged in relation to each other (horizontally, vertically,</p><p>etc.) to a precise positions on the window by means of the so called structural components<sup>9</sup> [<xref ref-type="bibr" rid="scirp.88902-ref11">11</xref>] [<xref ref-type="bibr" rid="scirp.88902-ref12">12</xref>] . Presented this way, one can easily realize that, the rules governing the grouping of the (basics and/or structural) components of a GUI can be described using the production rules of a CFG. Therefore, a GUI (tree structure) can be intentionally represented by an AST of a CFG. In fact, for a given graphical application, we can construct a CFG in such a way that, any of its GUIs is intentionally represented by an AST of the latter (see Section 3.2.1): CFG can be used as models of the GUIs of an application. This is the use made of it in this paper.</p><p>Recall that a CFG defines the structure of its instances (AST) by means of productions. A production, generally denoted p : X 0 → X 1 ⋯ X n is assimilated in the GUIs context, to a structuring rule showing how the component X 0 , located on the left hand side of the production, allows structuring/grouping the other components X 1 ⋯ X n located on the right hand side. More formally, we have the following definition:</p><p>Definition 1 An abstract context free grammar (CFG) is given by G = ( S , P , A ) composed of a finite set S of grammatical symbols or sorts corresponding to the different syntactic categories involved, a particular grammatical symbol A ∈ S called axiom, and a finite set P ⊆ S &#215; S ∗ of productions. A production P = ( X P ( 0 ) , X P ( 1 ) ⋯ X P ( | P | ) ) is denoted P : X P ( 0 ) → X P ( 1 ) ⋯ X P ( | P | ) , | P | denotes the length of its right hand side and l h s ( P ) (resp. r h s ( P ) return its left (resp. right) hand side. A production with the symbol X as left part ie. #Math_20#, is called a X-production.</p><p>An AST is a tree whose nodes are labeled by the grammatical symbols of the grammar and is such that, for any internal node labeled X , having n sons labeled X 1 , ⋯ , X n , rule X → X 1 ⋯ X n must be a grammar production. Moreover, the leaf nodes must be associated with ε -productions.</p><p>Definition 2 The set A S T ( G , X ) of abstract syntax trees according to the grammar G associated with grammatical symbol X consists of trees in the form X [ t 1 , ⋯ , t n ] where X is the label of the root node<sup>10</sup> of the tree, t 1 ⋯ t n are subtrees of the root node and there is a production P : X → X 1 ⋯ X n such that X = X P ( 0 ) , n = | P | and t i ∈ A S T ( G , X i ) for all 1 ≤ i ≤ n .</p><p>AST can be interpreted as evidence of the conformity of the GUI (tree structure) with the grammar.</p></sec><sec id="s2_2"><title>2.2. On Software Localization: External vs. Inner Localization</title><p>The localization of a software does not only concern its GUIs. This is an activity that also includes the technical documentation provided with the software (installation guides, user manuals, etc.), online help and so on [<xref ref-type="bibr" rid="scirp.88902-ref13">13</xref>] .</p><p>When the need to locate softwares was felt, the first answer given to this new challenge by the software publishers was purely linguistic and recommended working directly on the source code of the application: this is what we call inner software localization [<xref ref-type="bibr" rid="scirp.88902-ref4">4</xref>] . Since the strings to be translated are generally scattered throughout the application’s code, the localizer must have access to it. The latter must then be either a translator with programming knowledge, or a programmer with translation knowledge, or both must work in perfect intelligence.</p><p>Granting free access to the source code to a third party who is not the editor poses at least the problem of security and confidentiality. Indeed, since translators do not generally have a great programming knowledge, the risk is great that they inadvertently modify, or copy for unconfessed purposes the source code available to them for translation [<xref ref-type="bibr" rid="scirp.88902-ref4">4</xref>] .</p><p>In the early nineties, a new form of localization using resource files<sup>11</sup> and called external software localization [<xref ref-type="bibr" rid="scirp.88902-ref14">14</xref>] has been created. It allows translators to process the text contained in the GUIs without need to have any particular programming knowledge, or to constantly need the assistance of the programmers. They only intervene on the resource file (containing localizations of localizable elements such as text, etc.) which is subsequently delivered with the software product. In production, the choice of the localization to use for a particular running of the software is done either interactively at the start of the software, or is previously set in a configuration file. By doing so, the software developed is not only completely independent of the end user culture, but is also highly extensible from a localization perspective. Indeed, it is enough to create a new localization file containing data relating to a new culture, for it to be taken into account by the tool.</p><p>Recall that the work presented in this manuscript focuses exclusively on the external localization of GUIs.</p></sec></sec><sec id="s3"><title>3. A grammatical Approach of External Multi-Localization of GUIs</title><sec id="s3_1"><title>3.1. Derivation of a (Parameterized) Functional Interpreter of ASTs</title><p>We have seen (section 2.1) that the logical structure of a GUI can be represented by an abstract CFG.</p><p>Let G 1 = ( S , P , A ) with P = { P 1 : X → X 1 ⋯ X n , P 2 : X → Y 1 ⋯ Y m , ⋯ , P k : X → Z 1 ⋯ Z l } , be a grammatical model of GUIs of a software. We present in this subsection how to encode G 1 , its ASTs as well as their interpreters in the functional language Haskell.</p><p>Well-known techniques describing how to carry out a functional implementation of a CFG, and how to write interpreters of its ASTs exist [<xref ref-type="bibr" rid="scirp.88902-ref15">15</xref>] [<xref ref-type="bibr" rid="scirp.88902-ref16">16</xref>] . We briefly present below how we proceed. Note that, our way of doing things is not fundamentally different from others but has the advantage of being modular. Indeed, whereas generally a single algebra structure is associated with a grammar, we suitably associate an algebra structure with each syntactic category of the grammar and consider in fine that, the algebra structure associated with the grammar is the one associated with its axiom.</p><p>Abstract grammar allows to specify syntactic structures that can be associated in Haskell to a set of algebraic data types<sup>12</sup> describing the different syntactic categories used in grammar. Terms of a data structure are generally subject to several interpretations, all of them following the same recursion pattern. This is why they are generally specified by means of algebras<sup>13</sup> formally defined as follows:</p><p>Definition 3 Let G = ( S , P , A ) be a CFG. An algebra A X associated with a grammar symbol X ∈ S is given by: 1) an interpretation domain D Y associated with each grammar symbol Y appearing in a X -production of P , 2) a reference to the A Z algebra of each grammar symbol Z appearing on the right-hand side of a X -production. 3) an application P A : D X P ( 1 ) &#215; ⋯ &#215; D X P ( | P | ) → D X associated with each X -production P : X → X P ( 1 ) ⋯ X P P ( | P | ) . The algebra A G associated with the grammar G = ( S , P , A ) is the one associated with his axiom A : A G = A A .</p><p>Given an abstract grammar G = ( S , P , A ) , we deduce from systematic way the Haskell data types, the associated algebra data types, and the evaluation functions (catamorphisms<sup>14</sup>) as follows:</p><p>1) A data type is created for each grammar symbol.</p><p>2) For each created data type, an associated algebra data type is created. It consists of two groups of selectors:</p><p>• The group formed by types of interpretation functions of algebraic data type: there is one for each data constructor of algebraic data type,</p><p>• The group containing references to algebras associated with the different algebraic data types used in the definition of the type of which the current algebra is associated.</p><p>3) For each data type created, an evaluation function encapsulating the recursion pattern is created; it is parameterized by the algebra associated with this data type.</p><p>Application of the approach to the grammar G 1</p><p>1) Creating data types:</p><disp-formula id="scirp.88902-formula3"><graphic  xlink:href="//html.scirp.org/file/3-9302559x62.png"  xlink:type="simple"/></disp-formula><p>2) Creation of data types for algebras: D X i denotes the type variable representing the interpretation domain of the type X i .</p><disp-formula id="scirp.88902-formula4"><graphic  xlink:href="//html.scirp.org/file/3-9302559x65.png"  xlink:type="simple"/></disp-formula><p>3) Evaluation function parameterized by algebra data type associated to X data type<sup>15</sup>.</p><disp-formula id="scirp.88902-formula5"><graphic  xlink:href="//html.scirp.org/file/3-9302559x67.png"  xlink:type="simple"/></disp-formula></sec><sec id="s3_2"><title>3.2. A Multi-Localization Approach: The Steps</title><p>In order to be intensively localizable, GUIs have to be internationalised to abstract any information directly related to a culture. This justifies the decomposition of our multi-localization approach into two phases: an internationalization phase whose objective is to produce a grammatical model (an abstract grammar) of all the GUIs of the software; followed by a phase of multi-localization, whose objective is to produce on the fly, located GUIs for each of the participants in the collaboration.</p><sec id="s3_2_1"><title>3.2.1. The Internationalization Phase</title><p>The internationalization phase can be considered as an analysis-design phase, allowing not only to identify the localizable elements of the GUIs for the abstraction purpose, but also to highlight the structural relations which exist between them. Only a summary description of this phase is given below, because it is not the main object of this study. It takes place in four steps:</p><p>1) Sketching: produce a sketch of all the GUIs of the software. This can be done because, this set is finished.</p><p>2) Identification: identify for each GUI the localizable elements for their abstraction; symbolic names will be found and only one occurrence of similar elements appearing in more than one GUI is retained.</p><p>3) Production of ASTs: identify the structural relationships between localizable elements of the GUIs and for each relation identified, study constraints related to the relationship; for example, the meaning of the relation that can be different from one culture to another, etc. This step ends with the production of an AST draft for each GUI: this is its intentional representation.</p><p>4) Derivation of the grammar model of the application’s GUIs: from the different ASTs produced in the previous step, derive their CFG by considering that, the set of AST’s labels form the set of grammatical symbols and that, a label of a inner node and those of its directs children form a production.</p></sec><sec id="s3_2_2"><title>3.2.2. The Multi-Localization Phase</title><p>This phase starts after the previous one and takes as input the grammar produced. It takes place in three steps (see <xref ref-type="fig" rid="fig2">Figure 2</xref>):</p><p>1) Generation of data structures: generate from the grammar data structures, algebras data structures and evaluation functions for each grammatical symbol (<xref ref-type="fig" rid="fig2">Figure 2</xref>-Step1) as described in section (see section 3.1).</p><p>2) The choice of GUIs description language(s) and cultures to be located: the produced GUIs are described in a (textual) language like FXML [<xref ref-type="bibr" rid="scirp.88902-ref9">9</xref>] , UIML [<xref ref-type="bibr" rid="scirp.88902-ref10">10</xref>] , etc. An implementation of algebra must therefore be provided for each of the target GUI (textual) description languages. Likewise, a localization file must be produced for each target culture (<xref ref-type="fig" rid="fig2">Figure 2</xref>-Step2).</p><p>3) Multi-localization: at the running time, the located GUI is obtained by invoking the evaluation function associated with the axiom of the grammar. An instance of algebra corresponding to the desired description language, and the localization file related to the target culture are provided as effective parameters during this invocation (<xref ref-type="fig" rid="fig2">Figure 2</xref>-Step3).</p><p>External localization of software uses resource files that can be in the binary (.DLL, .EXE, etc.) or text format. In the following, we will call localization file a text resource file, containing in addition to strings to display in the GUI (linguistic aspect), other cultural information (color codes, disposition order of components, etc.) whose suitable use by the ASTs interpretation functions will provide a located GUI in which, not only linguistic concerns are addressed.</p><p>A localization file is structured in sections, and each of them contain information about a specific cultural concern addressed (language, color, components layout, etc.). Each section is structured as an associative list, ie. a list of pairs (key, value) where key is the identifier of a resource (its internationalized form), and value its concrete representation in the current target culture. We have on the listing 6 an example of a localization file.</p></sec></sec><sec id="s3_3"><title>3.3. Experimentation: Application to the Multi-Localization of the Checkers Game GUI</title><p>Recall that checkers game consists of a set of pieces that moves according to precise rules, on a checkerboard made up of 100 squares. It is played by at least 2 players and each player has 20 pieces of single color, which is distinct from the color of pieces of the other player. The goal of checkers game is to take or block the largest number of opposing pieces.</p><p>Considering that a checkers game can only be played by at least 2 players, it can be implemented and played in a network: it is therefore a kind of cooperative application. One can easily imagine a checkers game played by participants belonging to different cultural areas. As mentioned in the introduction (Section 1), the game’s GUI can be multi-located in order to improve for each player his application’s use comfort: each of the participants will then interact on a located GUI relating to his culture.</p><p>The rest of this subsection presents how this goal can be achieved by applying the multi-localization approach described in Section 3.2. Note that our goal here is not to build a fully functional checkers game, but, to present how our approach can easily derive a multi-located GUI for the latter. For a better understanding of the example, we presented on <xref ref-type="fig" rid="fig3">Figure 3</xref>, the orchestration diagram summarizing the interaction between different players during a game: any action of a player (moving a piece) on his GUI is raised at the AST level and the GUI of the other player is immediately updated accordingly; bidirectional binding [<xref ref-type="bibr" rid="scirp.88902-ref17">17</xref>] is implemented between each localized GUI and the AST.</p><sec id="s3_3_1"><title>3.3.1. Localizable Elements and AST of the Checkers Game</title><p>For illustration purposes, we have retained in addition to the GUI components related to the linguistic aspect, some others whose interpretation may vary from one culture to another. Finally, the localizable elements selected for our toy application are: strings (the linguistic aspect), colors, images of the pieces, layout</p><p>components of the GUI and the chronometer displaying the remaining time at the end of which the player must have moved a piece: his color will have to change as soon as this time reaches a certain threshold.</p><p>From the abstraction of its elements and the structural relations that can be identified between them, we have the AST of <xref ref-type="fig" rid="fig4">Figure 4</xref> in which, the components Label, Button, ImageView, TextField (resp. Vbox, Hbox, Gridpane) are abstractions of basic (resp. structuring/layout) components that names are related to those that we generally have in the GUI’s build libraries.</p></sec><sec id="s3_3_2"><title>3.3.2. GUI’s Grammar for the Checkers Game</title><p>From the abstract representation of checkers game (<xref ref-type="fig" rid="fig4">Figure 4</xref>) one can derive abstract grammar whose productions (an extract) are presented on the listing 1.</p><p>Listing 1: GUI’s grammar for the checkers game</p><p>In the listing 1, grammar symbols that do not appear on the left hand side of any production are assumed to be associated with ε -productions (not shown in this listing). In addition, in line 3, the notation “*” simply means that the grammar symbol Vbox is used to structure zero or more BaseCompOrGroup components.</p></sec><sec id="s3_3_3"><title>3.3.3. Data Structures Derived from the Grammar of the Listing 1</title><p>An extract is given in the listing 2. Note that, a flat must be made to what have been said in Section 3.1 with regard to the data types to create. In fact, we will not create neither a Haskell data type nor algebra for grammatical symbols that we call linguistic symbols; these are symbolic names whose concrete value in the language of target culture is given in the localization file. In the listing 1, these are the grammatical symbols whose names have “.game” as extension; they are represented by the type String (their domain of interpretation) in the listing 2, lines 7 and 8.</p><p>Listing 2: Data structures derived from the grammar of the listing 1</p><disp-formula id="scirp.88902-formula6"><graphic  xlink:href="//html.scirp.org/file/3-9302559x72.png"  xlink:type="simple"/></disp-formula><p>Listing 3 presents the Haskell code of the algebraic structures associated with the data types of the listing 2. In this one, the types variables D V b o x , D H b o x , D A s t , etc. represent the interpretation domains of the respective components, Vbox, Hbox, Ast, etc. Note that, the interpretation functions of derived algebraic structures, use data contained in the localization file. The latter is therefore provided as a parameter (listing 3, lines 7 and 10), and treated as an inherited attribute<sup>16</sup> associated with all the syntactic categories of the grammar.</p><p>During the scanning of a linearization of the AST, the checkers board is generated when GridPane is met. The syntactic categories BaseCompOrgroup, BaseComp and Ast are used only for factorisation purposes (reducing the number of productions), the interpretation functions of algebra that are associated do not use data contained in the localization file: they do not take it as a parameter as it is the case for other algebras.</p><p>Listing 3: Some algebras structures derived from the grammar of the listing 1</p><disp-formula id="scirp.88902-formula7"><graphic  xlink:href="//html.scirp.org/file/3-9302559x76.png"  xlink:type="simple"/></disp-formula><p>As for the interpretation functions of algebras, the evaluation functions parameterized by algebras (listing 4) use data contained in the localization file; it is therefore provided as a parameter to these functions, and they must propagate it in the AST, by making them available at the level of each of their sons (listing 4, line 4).</p><p>Listing 4: The catamorphisms associated with the algebras of the listing 3</p><disp-formula id="scirp.88902-formula8"><graphic  xlink:href="//html.scirp.org/file/3-9302559x77.png"  xlink:type="simple"/></disp-formula></sec><sec id="s3_3_4"><title>3.3.4. An Implementation of Algebra for FXML</title><p>For the checkers game, we chose FXML as the GUI description language. All syntactic categories, except those qualified as linguistic symbols, therefore have FXML as interpretation domain. A particular implementation of the algebra of the listing 3, of which an extract is given in the listing 5, makes it possible to encode the located GUIs in FXML. It basically contains instructions for creating (insertion of tags) a well-formed and valid FXML file.</p><p>Listing 5: An algebra for the localized interpretation of AST in FXML</p><disp-formula id="scirp.88902-formula9"><graphic  xlink:href="//html.scirp.org/file/3-9302559x79.png"  xlink:type="simple"/></disp-formula></sec><sec id="s3_3_5"><title>3.3.5. Localization Files</title><p>For illustrative purposes and without detracting from the generality, we have choose to multi-locate the GUI of the checkers game according to two cultures: “Western like culture” and “African like culture”. Their respective localization files are given in the listings 6 and 7. They have been save in files named respectively fichLocalWestern and fichLocalAfrican, which are used in listing 8.</p><p>Listing 6: Localization file for a “Western like culture”</p><disp-formula id="scirp.88902-formula10"><graphic  xlink:href="//html.scirp.org/file/3-9302559x80.png"  xlink:type="simple"/></disp-formula><p>Listing 7: Localization file for an “African like culture”</p><disp-formula id="scirp.88902-formula11"><graphic  xlink:href="//html.scirp.org/file/3-9302559x81.png"  xlink:type="simple"/></disp-formula></sec><sec id="s3_3_6"><title>3.3.6. Located GUIs</title><p>The FXML codes of the located GUIs of the AST of the <xref ref-type="fig" rid="fig4">Figure 4</xref>, in each of the two target cultures, are obtained by invoking the function cataAST (listing 8) as described in the subsection 3.2.2. Once the FXML files are created, they can be viewed by using a FXML interpreter such as sceneBuilder<sup>17</sup> to have the outputs given by <xref ref-type="fig" rid="fig5">Figure 5</xref>.</p><p>Listing 8: FXML localizations of the AST of the <xref ref-type="fig" rid="fig4">Figure 4</xref></p><disp-formula id="scirp.88902-formula12"><graphic  xlink:href="//html.scirp.org/file/3-9302559x82.png"  xlink:type="simple"/></disp-formula></sec></sec></sec><sec id="s4"><title>4. Conclusions</title><p>In this paper, we presented an external multi-localization approach of GUIs of interactive software. It can be used for the implementation of both collaborative and standalone applications, in order to adapt on the fly the end user’s GUI to its own culture: The user experience is therefore improved.</p><p>The approach has been experimented with great satisfaction for the development of the multi-located GUI of checkers game, whose main lines of its implementation have been presented in this manuscript.</p><p>The proposed approach is based on the use of functional techniques for the interpretation of abstract structures by the means of algebras. The use of algebras gives to the programmer the latitude to offer with a lower intellectual investment the same localizations in various GUI description languages. Since the kind of localization explored in this paper uses localization files, the proposed</p><p>approach may allow even a non-computer specialist to increment the localization degree (adding a new culture) of a software as soon as it has already been located for at least one culture: It is enough for that to adequately create a new localization file for the new target culture. Note however that, the creation of the new file will be easier if one can do it by the mean of a DSL (Domain Specific Language) [<xref ref-type="bibr" rid="scirp.88902-ref18">18</xref>] ; this is one of the immediate perspectives of this work: that is, to investigate about an implementation of the proposed method as a software system, that generate code from high-level description, in order to not leave too much manual low-level writing of boilerplate code (like the one in the listing 5) to the software developer.</p></sec><sec id="s5"><title>Acknowledgements</title><p>Authors warmly thank professor Tayou Djameni Cl&#233;mentin for enriching discussions they had, during both laboratory seminars and the defense of Master’s thesis of Mr. Tatou Freddy.</p></sec><sec id="s6"><title>Conflicts of Interest</title><p>The authors declare no conflicts of interest regarding the publication of this paper.</p></sec><sec id="s7"><title>Cite this paper</title><p>Tchendji, M.T. and Ahoukeng, F.-V.T. (2018) A Grammatical Approach of Multi-Localization of GUIs: Application to the Multi-Localization of the Checkers Game GUI. Journal of Software Engineering and Applications, 11, 552-567. https://doi.org/10.4236/jsea.2018.1111033</p></sec><sec id="s8"><title>NOTES</title></sec></body><back><ref-list><title>References</title><ref id="scirp.88902-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Sommet mondial des dirigeants locaux et régionaux - 3ème congrès mondial de cglu, mexico, 2010. https://www.uclg-cisdp.org/en/node/1078</mixed-citation></ref><ref id="scirp.88902-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">UNESCO (2002) Déclaration universelle de l’unesco sur la diversité culturelle. 
http://unesdoc.unesco.org/images/0012/001271/127162f.pdf</mixed-citation></ref><ref id="scirp.88902-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Rauterberg, G.W.M. (2015) From Personal to Cultural Computing: How to Assess a Cultural Experience. Pabst Science Publisher, 13-21.</mixed-citation></ref><ref id="scirp.88902-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Fraisse, A. (2010) Internal and in Context Localisation of Commercial and Free Software. Theses, Université de Grenoble.</mixed-citation></ref><ref id="scirp.88902-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Esselink, B. (2000) A Practical Guide to Localization. Benjamins, John Publishing Company. https://doi.org/10.1075/liwd.4</mixed-citation></ref><ref id="scirp.88902-ref6"><label>6</label><mixed-citation publication-type="book" xlink:type="simple">Sch&amp;#228;ler, R. (2007) Localization. In: Baker, M. and Saldanha, G., Eds., Encyclopedia of Translation Studies, 2nd Edition, 157-161.</mixed-citation></ref><ref id="scirp.88902-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Davie, A.J.T. (1992) An Introduction to Functional Programming Systems Using Haskell. Cambridge University Press, New York.</mixed-citation></ref><ref id="scirp.88902-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Doets, K. and Van, J.E. (2004) The Haskell Road To Logic, Maths and Programming. King’s College Publications.</mixed-citation></ref><ref id="scirp.88902-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Schildt, H. (2015) Introducing JavaFX 8 Programming. 1st Edition, McGraw-Hill Education Group.</mixed-citation></ref><ref id="scirp.88902-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Abrams, M., Phanouriou, C., Batongbacal, A.L., Williams, S.M. and Shuster, J.E. (1999) Uiml: An Appliance-Independent XML User Interface Language. Computer Networks, 31, 1695-1708. https://doi.org/10.1016/S1389-1286(99)00044-4</mixed-citation></ref><ref id="scirp.88902-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Ganneau, V., Calvary, G. and Demumieux, R. (2007) Métamodèle de règles d’adaptation pour la plasticité des interfaces homme-machine. Proceedings of the 19th Conference on L’Interaction Homme-Machine, IHM ‘07, Paris, 13-15 November 2007, 91-98. https://doi.org/10.1145/1541436.1541454</mixed-citation></ref><ref id="scirp.88902-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Gabillon, Y. (2011) Composition d’interfaces homme-machine par planification automatique. In Interface Homme-Machine [cs.HC]. Université de Grenoble, Grenoble.</mixed-citation></ref><ref id="scirp.88902-ref13"><label>13</label><mixed-citation publication-type="book" xlink:type="simple">Reina, L.A., Robles, G. and González-Barahona, J.M. (2013) A Preliminary Analysis of Localization in Free Software: How Translations Are Performed. In: Petrinja, E., Succi, G., Ioini, N. and Sillitti, A., Eds., 9th Open Source Software (OSS), volume AICT-404 of Open Source Software: Quality Verification, Part 1: Full Papers—Practices and Methods, Springer, Koper-Capodistria, 153-167.</mixed-citation></ref><ref id="scirp.88902-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Dirk, S.K. (2005) Internationalisierung und lokalisierung von software. In: Reineke and Schmitz Klaus, Einführung in die Softwarelokalisierung, Gunter NarrVerlag, Tübingen, 11-26.</mixed-citation></ref><ref id="scirp.88902-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">Backhouse, K. (2002) A Functional Semantics of Attribute Grammars. Proceedings of the 8th International Conference on Tools and Algorithms for the Construction and Analysis of Systems, TACAS ‘02, Springer-Verlag, Berlin, 142-157.  
https://doi.org/10.1007/3-540-46002-0_11</mixed-citation></ref><ref id="scirp.88902-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Fokkinga, M., Jeuring, J., Meertens, L. and Meijer, E. (1991) A Translation from Attribute Grammars to Catamorphisms. The Squiggolist, 2, 20-26.</mixed-citation></ref><ref id="scirp.88902-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">Hu, Z.J., Mu, S.-C. and Takeichi, M. (2008) A Programmable Editor for Developing Structured Documents Based on Bidirectional Transformations. Higher-Order and Symbolic Computation, 21, 89-118. https://doi.org/10.1007/s10990-008-9025-5</mixed-citation></ref><ref id="scirp.88902-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Van Deursen, A., Klint, P. and Visser, J. (2000) Domain-Specific Languages: An Annotated Bibliography. ACM SIGPLAN Notices, 35, 26-36.  
https://doi.org/10.1145/352029.352035</mixed-citation></ref></ref-list></back></article>