plugins/Cortado.php
author Dan
Sun, 16 Mar 2008 01:43:46 -0400
changeset 1 ca59733d84da
parent 0 da45dd7fc9ec
permissions -rw-r--r--
Localized the plugin; as this is the first plugin ever localized, specifications may change.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
     1
<?php
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
     2
/*
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
     3
Plugin Name: Cortado applet support
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
     4
Plugin URI: http://enanocms.org/
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
     5
Description: Extends the [[:File:foo]] tag to support Ogg Vorbis and Ogg Theora files, and can embed a player in place of those tags.
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
     6
Author: Dan Fuhry
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
     7
Version: 0.1b1
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
     8
Author URI: http://enanocms.org/
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
     9
*/
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    10
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    11
/*
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    12
 * Cortado applet extension for Enano
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    13
 * Version 0.1
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    14
 * Copyright (C) 2008 Dan Fuhry
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    15
 *
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    16
 * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    17
 * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    18
 *
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    19
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    20
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    21
 *
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    22
 * This extension uses the Cortado Java applet written by Flumotion, Inc. The applet is also under the GNU GPL; see
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    23
 * <http://www.flumotion.net/cortado/> for details.
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    24
 */
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    25
 
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    26
global $db, $session, $paths, $template, $plugins; // Common objects
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    27
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    28
// Establish our parser hook
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    29
$plugins->attachHook('render_wikiformat_pre', 'cortado_process($text);');
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    30
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    31
function cortado_process(&$text)
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    32
{
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    33
  global $db, $session, $paths, $template, $plugins; // Common objects
1
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
    34
  global $lang;
0
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    35
  
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    36
  $match_count = preg_match_all('#\[\[:' . preg_quote($paths->nslist['File']) . '([^]]+?\.ogg)(\|video)?\]\]#is', $text, $matches);
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    37
  if ( $match_count < 1 )
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    38
    // No media tags - might as well just abort here.
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    39
    return false;
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    40
    
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    41
  // Is there a template for this theme? If not, use a bare-bones generic default.
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    42
  if ( file_exists( ENANO_ROOT . "/themes/{$template->theme}/cortado.tpl" ) )
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    43
  {
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    44
    $player_template = strval(@file_get_contents(ENANO_ROOT . "/themes/{$template->theme}/cortado.tpl"));
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    45
  }
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    46
  else
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    47
  {
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    48
    $player_template = <<<TPLCODE
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    49
    
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    50
      <!-- Start embedded player: {FILENAME} -->
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    51
      
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    52
        <div class="cortado-wrap">
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    53
          <applet id="cortado_{UUID}" code="{JAVA_CLASS}.class" archive="{JAVA_JARFILES}" width="352" <!-- BEGIN video -->height="288"<!-- BEGINELSE video -->height="16"<!-- END video -->>
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    54
            <param name="url" value="{FILE_PATH}"/>
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    55
            <param name="local" value="false"/>
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    56
            <param name="keepAspect" value="true"/>
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    57
            <param name="video" value="<!-- BEGIN video -->true<!-- BEGINELSE video -->false<!-- END video -->"/>
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    58
            <param name="audio" value="true"/>
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    59
            <param name="bufferSize" value="200"/>
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    60
            <param name="autoPlay" value="false"/>
1
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
    61
            {lang:cortado_err_no_java}
0
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    62
          </applet>
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    63
          <div class="cortado-controls">
1
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
    64
            <a href="#" onclick="document.applets['cortado_{UUID}'].doPlay(); return false;">{lang:cortado_btn_play}</a> |
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
    65
            <a href="#" onclick="document.applets['cortado_{UUID}'].doPause(); return false;">{lang:cortado_btn_pause}</a> |
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
    66
            <a href="#" onclick="document.applets['cortado_{UUID}'].doStop(); return false;">{lang:cortado_btn_stop}</a>
0
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    67
          </div>
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    68
        </div>
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    69
      
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    70
      <!-- End embedded player: {FILENAME} -->
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    71
    
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    72
TPLCODE;
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    73
  }
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    74
  
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    75
  $parser = $template->makeParserText($player_template);
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    76
  
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    77
  foreach ( $matches[0] as $i => $entire_match )
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    78
  {
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    79
    // Sanitize and verify the filename
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    80
    $filename = sanitize_page_id($matches[1][$i]);
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    81
    $filename_paths = $paths->nslist['File'] . $filename;
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    82
    
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    83
    // Make sure the file even exists
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    84
    if ( !isPage($filename_paths) )
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    85
      continue;
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    86
    
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    87
    // Verify permissions
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    88
    $acl = $session->fetch_page_acl($filename, 'File');
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    89
    if ( !$acl->get_permissions('read') )
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    90
    {
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    91
      // No permission to read this file
1
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
    92
      $text = str_replace_once($entire_match, "<span class=\"cortado-error\">" . $lang->get('cortado_err_access_denied', array('filename' => $filename)) . "</span>", $text);
0
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    93
      continue;
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    94
    }
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    95
    
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    96
    // We should be good, set up the parser
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    97
    $parser->assign_vars(array(
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    98
        'FILENAME' => $filename,
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
    99
        'FILE_PATH' => makeUrlNS('Special', "DownloadFile/$filename", false, true),
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
   100
        'JAVA_CLASS' => 'com.fluendo.player.Cortado',
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
   101
        'JAVA_JARFILES' => scriptPath . '/plugins/cortado/cortado-ovt.jar',
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
   102
        'UUID' => $session->dss_rand()
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
   103
      ));
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
   104
    
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
   105
    $parser->assign_bool(array(
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
   106
       'video' => ( $matches[2][$i] === '|video' )
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
   107
      ));
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
   108
    
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
   109
    // Run the template code and finish embed
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
   110
    $applet_parsed = $parser->run();
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
   111
    
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
   112
    $text = str_replace_once($entire_match, $applet_parsed, $text);
da45dd7fc9ec First commit. Parser extension is working. Applet is working but tends to crash the browser in many circumstances.
Dan
parents:
diff changeset
   113
  }
1
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   114
}
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   115
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   116
/**!language**
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   117
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   118
The following text up to the closing comment tag is JSON language data.
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   119
It is not PHP code but your editor or IDE may highlight it as such. This
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   120
data is imported when the plugin is loaded for the first time; it provides
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   121
the strings displayed by this plugin's interface.
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   122
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   123
You should copy and paste this block when you create your own plugins so
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   124
that these comments and the basic structure of the language data is
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   125
preserved. All language data is in the same format as the Enano core
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   126
language files in the /language/* directories. See the Enano Localization
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   127
Guide and Enano API Documentation for further information on the format of
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   128
language files.
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   129
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   130
The exception in plugin language file format is that multiple languages
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   131
may be specified in the language block. This should be done by way of making
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   132
the top-level elements each a JSON language object, with elements named
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   133
according to the ISO-639-1 language they are representing. The path should be:
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   134
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   135
  root => language ID => categories array, strings object => category \
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   136
  objects => strings
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   137
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   138
All text leading up to first curly brace is stripped by the parser; using
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   139
a code tag makes jEdit and other editors do automatic indentation and
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   140
syntax highlighting on the language data. The use of the code tag is not
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   141
necessary; it is only included as a tool for development.
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   142
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   143
<code>
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   144
{
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   145
  // english
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   146
  eng: {
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   147
    categories: [ 'meta', 'cortado' ],
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   148
    strings: {
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   149
      meta: {
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   150
        cortado: 'Cortado plugin'
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   151
      },
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   152
      cortado: {
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   153
        err_no_java: 'Your browser doesn\'t have a Java plugin. You can get Java from <a href="http://java.com/">java.com</a>.',
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   154
        err_access_denied: 'Access to file "%filename%" is denied, so the media player can\'t be loaded here.',
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   155
        btn_play: 'Play',
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   156
        btn_pause: 'Pause',
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   157
        btn_stop: 'Stop'
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   158
      }
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   159
    }
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   160
  }
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   161
}
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   162
</code>
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   163
ca59733d84da Localized the plugin; as this is the first plugin ever localized, specifications may change.
Dan
parents: 0
diff changeset
   164
**!*/