Ticket #7948: 7948.patch

File 7948.patch, 3.6 KB (added by Garry Yao, 13 years ago)
  • _source/lang/en.js

     
    121121                alignBottom             : 'Bottom',
    122122                invalidHeight   : 'Height must be a number.',
    123123                invalidWidth    : 'Width must be a number.',
    124                 invalidCssLength        : 'Value specified for the "%1" field must be a positive number with or without a valid CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).',
    125                 invalidHtmlLength       : 'Value specified for the "%1" field must be a positive number with or without a valid HTML measurement unit (px or %).',
     124                invalidCssLength        : 'Value specified for the "%1" field must be a positive number with or without a valid #{common.cssLengthUnit}',
     125                invalidHtmlLength       : 'Value specified for the "%1" field must be a positive number with or without a valid #{common.htmlLengthUnit}',
     126                cssLengthUnit : 'CSS measurement unit (px, %, in, cm, mm, em, ex, pt, or pc).',
     127                htmlLengthUnit : 'HTML measurement unit (px or %).',
    126128
    127129                // Put the voice-only part of the label in the span.
    128130                unavailable             : '%1<span class="cke_accessibility">, unavailable</span>'
     
    257259                rows            : 'Rows',
    258260                columns         : 'Columns',
    259261                border          : 'Border size',
     262                widthTitle : 'Table width specified with or without a valid #{common.cssLengthUnit}',
     263                heightTitle : 'Table height specified with or without a valid #{common.cssLengthUnit}',
    260264                widthPx         : 'pixels',
    261265                widthPc         : 'percent',
    262266                widthUnit       : 'width unit',
  • _source/plugins/table/dialogs/table.js

     
    409409                                                                                                        id : 'txtWidth',
    410410                                                                                                        controlStyle : 'width:5em',
    411411                                                                                                        label : editor.lang.common.width,
     412                                                                                                        title : editor.lang.table.widthTitle,
    412413                                                                                                        'default' : 500,
    413414                                                                                                        getValue : defaultToPixel,
    414415                                                                                                        validate : CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength.replace( '%1', editor.lang.common.width ) ),
     
    436437                                                                                                        id : 'txtHeight',
    437438                                                                                                        controlStyle : 'width:5em',
    438439                                                                                                        label : editor.lang.common.height,
     440                                                                                                        title : editor.lang.table.heightTitle,
    439441                                                                                                        'default' : '',
    440442                                                                                                        getValue : defaultToPixel,
    441443                                                                                                        validate : CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength.replace( '%1', editor.lang.common.height ) ),
  • _source/core/lang.js

     
    77{
    88        var loadedLangs = {};
    99
     10        /*
     11         * Process all references embedded in the translation entry.
     12         */
     13        function resolveLang( lang )
     14        {
     15                function replacer( match, property )
     16                {
     17                        var props= property.split( '.' ),
     18                                val = lang;
     19
     20                        for ( var i = 0; i < props.length && val; i++ )
     21                                val = val[ props[ i ] ];
     22
     23                        return val;
     24                }
     25
     26                function traverse( obj )
     27                {
     28                        for ( var name in obj )
     29                        {
     30                                var val = obj[ name ];
     31                                if ( typeof val == 'object' )
     32                                         traverse( val );
     33                                else
     34                                        obj[ name ] = val.replace( /#\{(.*?)\}/g, replacer )
     35                        }
     36                }
     37
     38                traverse( lang );
     39        }
     40
    1041        /**
    1142         * @namespace Holds language related functions.
    1243         */
     
    108139                                        'lang/' + languageCode + '.js' ),
    109140                                        function()
    110141                                                {
     142                                                        resolveLang( this[ languageCode ] );
    111143                                                        callback( languageCode, this[ languageCode ] );
    112144                                                }
    113145                                                , this );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy