new purls

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

new purls

Bruce D'Arcus
FYI, I just registered some purls for the namespaces:

The current bib prefix should now be changed to bind to
http://purl.org/NET/xbiblio/citeproc
Likewise, the current cs prefix should now bind -- and the
citation-style schema needs to be changed -- to
http://purl.org/NET/xbiblio/csl.

Bruce



Reply | Threaded
Open this post in threaded view
|

localisation idea

Johan Kool
Hello Bruce and others,

I am trying to read through the xslt stuff. I noticed that text such as
"Anonymous" is hard coded. Wouldn't it be better to use a function that
looks up the text in a file.

1. From the DocBook (or whatever the source) the language of the text is
obtained, or the user specifies it in a parameter (less desirable, but
would be nice to allow).
2. Then when a localized text is needed a call to a function is made
with the string as parameter.
3. The function determines the current language, looks for the
associated file (such as nl.loc, de.loc, etc.).*
4. and then searches the file for the string. The file holds the
non-localized (English) and the localized string as a pair, the function
then returns the localized one. **

This quite similar to what is used to localize Cocoa applications.

* It's better to use a folder with a separate file for each language as
those files most likely has to be dealt with by several different
persons. There are standards for language abbreviations, which can be
used here.

** It's better to use English as the non-localized string instead of
some kind of identifier. If the loc files misses a localized counterpart
the English one can be used. It would be handy to have a en.loc in there
too, if only as a start point for translations.

I suppose that this can be done with xslt?

Now I'll continue reading the xslt stuff to gain better understanding of
the whole thing...

Regards,

Johan Kool


Reply | Threaded
Open this post in threaded view
|

Re: localisation idea

Bruce D'Arcus
On Dec 23, 2004, at 8:35 AM, Johan Kool wrote:

> I am trying to read through the xslt stuff. I noticed that text such
> as "Anonymous" is hard coded. Wouldn't it be better to use a function
> that looks up the text in a file.

Yes.  There's a lot of stuff in there that is not as clean as it should
be ;-)

> 1. From the DocBook (or whatever the source) the language of the text
> is obtained, or the user specifies it in a parameter (less desirable,
> but would be nice to allow).
> 2. Then when a localized text is needed a call to a function is made
> with the string as parameter.
> 3. The function determines the current language, looks for the
> associated file (such as nl.loc, de.loc, etc.).*
> 4. and then searches the file for the string. The file holds the
> non-localized (English) and the localized string as a pair, the
> function then returns the localized one. **

Wouldn't it be easier to handle all localization in the CSL style files?

Take a look and see what you think.  The idea I settled on is that
those files are language specific.  So we could add necessary features
there.

I have on the TODO, for example, the question about whether month
representation ought to be handled there.

Bruce



Reply | Threaded
Open this post in threaded view
|

Re: localisation idea

Bruce D'Arcus
On Dec 23, 2004, at 9:43 AM, Bruce D'Arcus wrote:

> Wouldn't it be easier to handle all localization in the CSL style
> files?

Let me see what you think Johan.  Here's what I propose as one way to
handle localization of the thing you mentioned, and of dates.

Here's a complete CSL file, with added content indicated with a <!--
+++ --> suffix.  Think of a) what will work in this context, and b) how
it would translate to a GUI editor.

<?xml version="1.0" encoding="utf-8"?>
<citationstyle xmlns="http://purl.org/NET/xbiblio/csl"
class="author-year" xml:lang="en">
   <info>
     <title>author-year</title>
     <author>
       <name>Bruce D’Arcus</name>
     </author>
     <dateCreated>2004-07-30</dateCreated>
     <basedOn>
       <title>Chicago</title>
       <version>15</version>
     </basedOn>
     <field>geography</field>
     <description>sample style file for author-year class</description>
   </info>
   <content>
     <names initialize-with=". " shorten-after="3" and-as="text"/>
     <dates>
       <months abbreviate-with="."> <!-- +++ -->
         <month number="01">Jan</month> <!-- +++ -->
         <month number="02">Feb</month> <!-- +++ -->
         <month number="03">Mar</month> <!-- +++ -->
         <month number="04">Apr</month> <!-- +++ -->
         <month number="05">May</month> <!-- +++ -->
         <month number="06">Jun</month> <!-- +++ -->
         <month number="07">July</month> <!-- +++ -->
         <month number="08">Aug</month> <!-- +++ -->
         <month number="09">Sept</month> <!-- +++ -->
         <month number="10">Oct</month> <!-- +++ -->
         <month number="11">Nov</month> <!-- +++ -->
         <month number="12">Dec</month> <!-- +++ -->
       </months> <!-- +++ -->
     </dates>
     <terms>
       <roles>
         <role term="editor">
           <renderas>
             <single>Ed.</single>
             <multiple>Eds.</multiple>
           </renderas>
         </role>
         <role term="translator">
           <renderas>
             <single>tran.</single>
             <multiple>trans.</multiple>
           </renderas>
         </role>
       </roles>
       <genres>
        <genre term="dissertation">
          <renderas>PhD Dissertation</renderas>
        </genre>
        <genre term="letter">
          <renderas>letter</renderas>
        </genre>
       </genres>
       <media>
        <medium term="cdrom">
          <renderas>CD-ROM</renderas>
        </medium>
       </media>
     </terms>
     <citation>
       <prefix>(</prefix>
       <entry delimiter="; ">
         <creator>
           <names-short/>
           <suffix>, </suffix>
         </creator>
         <year/>
         <point>
           <prefix>: </prefix>
         </point>
       </entry>
       <suffix>)</suffix>
     </citation>
     <bibliography author-as-sort-order="first-author">
       <reftype name="book">
         <creator>
           <names noname-substitute="Anonymous"/>   <!-- +++ -->
           <role>
             <prefix> </prefix>
           </role>
         </creator>
         <date>
           <year>
             <prefix> (</prefix>
             <suffix>) </suffix>
           </year>
         </date>
         <title font-style="italic">
           <suffix>, </suffix>
         </title>
         <origin>
           <place/>
           <publisher>
             <prefix>:</prefix>
           </publisher>
         </origin>
         <genre>
           <suffix>, </suffix>
         </genre>
         <medium>
           <prefix>(</prefix>
           <suffix>)</suffix>
         </medium>
         <availability>
           <physicalLocation>
             <suffix>, </suffix>
           </physicalLocation>
           <url>
             <prefix>, </prefix>
           </url>
         </availability>
       </reftype>
       <reftype name="chapter"> <!-- +++ am thinking of changing
"chapter" to "book-section" +++ -->
         <creator>
           <names noname-substitute="Anonymous"/>   <!-- +++ -->
           <role>
             <prefix> </prefix>
           </role>
           <suffix/>
         </creator>
         <date>
           <year>
             <prefix> (</prefix>
             <suffix>) </suffix>
           </year>
         </date>
         <title>
   <suffix> </suffix>
        </title>
         <container>
           <prefix>, In </prefix>
           <creator>
             <names/>
             <role>
               <prefix> </prefix>
             </role>
             <suffix>, </suffix>
           </creator>
           <title font-style="italic"/>
           <origin>
             <prefix> (</prefix>
             <place/>
             <publisher>
               <prefix>:</prefix>
             </publisher>
             <suffix>) </suffix>
           </origin>
           <part-details>
             <prefix/>
             <pages/>
           </part-details>
         </container>
         <availability>
           <physicalLocation/>
           <url/>
         </availability>
       </reftype>
       <reftype name="article">
         <creator>
           <names  noname-substitute="periodical-title"/>    <!-- +++ -->
         </creator>
         <date>
           <year>
             <prefix> (</prefix>
             <suffix>) </suffix>
           </year>
         </date>
         <title>
           <suffix>, </suffix>
         </title>
         <container>
           <title font-style="italic">
             <suffix>, </suffix>
           </title>
           <origin/>
           <part-details>
             <date>
               <month/>
               <day>
                 <prefix> </prefix>
               </day>
               <suffix>, </suffix>
             </date>
             <volume/>
             <issue>
               <prefix>(</prefix>
               <suffix>)</suffix>
             </issue>
             <pages/>
           </part-details>
         </container>
         <genre>
           <suffix>, </suffix>
         </genre>
         <medium>
           <prefix> (</prefix>
           <suffix>), </suffix>
         </medium>
         <availability>
           <prefix>available from: </prefix>
           <physicalLocation>
             <prefix>, </prefix>
           </physicalLocation>
           <url>
             <prefix>, </prefix>
           </url>
         </availability>
       </reftype>
     </bibliography>
   </content>
</citationstyle>



Reply | Threaded
Open this post in threaded view
|

Re: localisation idea

Johan Kool
Doesn't this have the disadvantage of having to do the translation for
every citation style again and again? Until now there are only a few,
in the end every journal could have its own.* Plus you are multiplying
the number of files needed. This way you need number of styles × number
of languages instead of number of styles + number of languages.

* In fact most journals only publish in one language anyway, so perhaps
that can be used as an argument for one file suggestion.

I guess it boils down to this:

one kind of file: a CSL file:
+ very fine grained control
- many files
- many translations that are exactly alike

two kind of files: a CSL file and a localization file:
+ less files
+ centralized translations
- less control

For the last one: one journal might want to read: Anonymous and another
may want Author unknown

I am not yet sure which of these two approaches is the best one...

Johan


Reply | Threaded
Open this post in threaded view
|

Re: localisation idea

Bruce D'Arcus
On Dec 23, 2004, at 5:49 PM, Johan Kool wrote:

> Doesn't this have the disadvantage of having to do the translation for
> every citation style again and again?

Yes.  Each style is simpler, but there are more of them.

> Until now there are only a few, in the end every journal could have
> its own.*

Yes.  The Endnote repository has something like 1,400.

> Plus you are multiplying the number of files needed. This way you need
> number of styles × number of languages instead of number of styles +
> number of languages.
>
> * In fact most journals only publish in one language anyway, so
> perhaps that can be used as an argument for one file suggestion.

Exactly.  The only styles likely to have more than one language are
core styles like Chicago.  I am an American, but if I publish in a
British journal, I need to use British spelling.  So, one style file.

> I guess it boils down to this:
>
> one kind of file: a CSL file:
> + very fine grained control
> - many files
> - many translations that are exactly alike

Scripts and GUIs can make the above easier though.  For example, the
"basedOn" fields can be used to auto-fill a new style.

Another advantage, though, is --- again -- it's simpler.  Imagine if
you had to edit or create a style file in a GUI, and had to manage 20
languages at once.  There are other places where language comes in;
places where you can't necessarily localize it reliably across styles.
For example, if you have a url, then you often do "available at" or
whatever.  If you have multiple language support within a style file,
you could end up with REALLY long and complex style documents.

We had this discussion on the OpenOffice bib dev list, and we sort of
concluded that single-language/style file is better.  It wasn't an
overwhelming position, though.

Bruce