# \[dev-biblio\] localization?

**URL:** <https://discourse.citationstyles.org/t/dev-biblio-localization/139>\
**Category:** CSL Development\
**Created:** [July 6, 2006, 1:47pm UTC](https://discourse.citationstyles.org/t/dev-biblio-localization/139 "2006-07-06T13:47:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [July 6, 2006, 1:47pm UTC](https://discourse.citationstyles.org/t/dev-biblio-localization/139/1 "2006-07-06T13:47:20Z")

</div>

I wonder if the easy way to do this is to remove all strings from CSL  
files, define a list of variables, and allow them to be implemented  
natively in software? That way the files are mostly simplified, and  
remain self-contained. Doing that, I could also move the prefix and  
suffix elements back to attributes, since they don’t have to carry any  
formatting information. Files become more compact, and any possible  
future OO code is simpler (prefix and suffix become simple attributes  
of an object, rather than full objects).

So thinking not in XML, but rather YAML, it could be as simple as this:

en:  
in: In  
and: and  
accessed: accessed  
date-accessed: date accessed  
presented-at: presented at  
editor-single-full: Editor  
editor-multiple-full: Editors  
editor-single-short: Ed  
editor-multiple-short: Eds  
edited-by: Edited By  
translator-single-full: Translator  
translator-multiple-full: Translators  
translator-single-short: Tran  
translator-multiple-short: Trans  
translated-by: Translated By

The style file would then just be responsible for selecting the right  
variables; something like:

I hadn’t done this earlier because I thought it wasn’t possible, but  
maybe I’m wrong.

The software would then know which specific variable to grab depending  
on, for example, the role and whether there is one or more. In code:

```
def print_role(role, type, form, single)
    case role
      when "editor"
        if type == "noun" and form == "short" and single == true then
          puts @@strings["en"]["editor-short"]
        end
    end
  end

```

Not the best code, but you get the idea.

Would that work?

Bruce

---

<div class="post-metadata">

**Author:** ![David\_Wilson](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@David\_Wilson](https://discourse.citationstyles.org/u/David_Wilson)\
**Post date:** [July 6, 2006, 11:11pm UTC](https://discourse.citationstyles.org/t/dev-biblio-localization/139/2 "2006-07-06T23:11:40Z")

</div>

> I wonder if the easy way to do this is to remove all strings from CSL  
> files, define a list of variables, and allow them to be implemented  
> natively in software? That way the files are mostly simplified, and  
> remain self-contained. Doing that, I could also move the prefix and  
> suffix elements back to attributes, since they don’t have to carry any  
> formatting information. Files become more compact, and any possible  
> future OO code is simpler (prefix and suffix become simple attributes  
> of an object, rather than full objects).  
> So thinking not in XML, but rather YAML …  
> snip …
> 
> I hadn’t done this earlier because I thought it wasn’t possible, but  
> maybe I’m wrong.
> 
> Would that work?  
> I think it would. It looks neat and is simpler to manage than my idea of the  
> using macro processing to achieve the same thing

The tables of english-\>‘other language’ strings could easily be added to list  
of task the international language translators need to work on.

david
