Show
Ignore:
Timestamp:
13.07.2010 13:21:10 (9 years ago)
Author:
kjdon
Message:

hack to make right to left languages look proper. new parameter to phind - textorientation. if set to rtl, set righttoleft to true. If this is true, then when making a new result item phrase, swap suffix and prefix

Location:
main/trunk/greenstone2/runtime-src/src/java/org/nzdl/gsdl/Phind
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/java/org/nzdl/gsdl/Phind/Phind.java

    r21878 r22384  
    123123    public boolean vertical; 
    124124    public int depth; 
    125  
     125  public boolean righttoleft; 
    126126    // Font 
    127127    public int fontSize; 
     
    702702        vertical = true; 
    703703    } 
     704 
    704705     
    705706    // How many phind windows are there? 
    706707    depth = parameterValue("depth", 3); 
    707708 
     709    // is the text right to left? 
     710    String rtl = parameterValue("textorientation", "ltr"); 
     711    if (rtl.equals("rtl")) { 
     712      righttoleft = true; 
     713    } else { 
     714      righttoleft = false; 
     715    } 
    708716    // Result sort order 
    709717    // Standard is "LlEeDd", expansion-first is "EeLlDd" 
  • main/trunk/greenstone2/runtime-src/src/java/org/nzdl/gsdl/Phind/ResultBox.java

    r2507 r22384  
    546546     
    547547    // Create a new ResultItem and add it to the display 
    548     ResultItemPhrase ri = new ResultItemPhrase(idStr, tfStr, dfStr, prefix, body, suffix); 
    549      
     548    ResultItemPhrase ri; 
     549    if (phind.righttoleft) { 
     550      // swap suffix and prefix 
     551      ri = new ResultItemPhrase(idStr, tfStr, dfStr, suffix, body, prefix); 
     552    } else { 
     553      ri = new ResultItemPhrase(idStr, tfStr, dfStr, prefix, body, suffix); 
     554    } 
    550555    if (c.addResultItem(ri)) { 
    551556        expansionsRetrieved++;