new project: Huggle

Edited by author.
Last edit: 15:35, 10 January 2014

here is the code, I have no idea what coding style you require, so feel free to reformat, it's obviously longer than 3 lines, because I add some comments and error checks too :-)

/*!
 * \brief Parses a line of translation text
 * \param line Line in ^key:\s*value$ syntax
 * \return array with 2 elements key and value or NULL in case that line can't be parsed
 */
function ParseLine($line)
{
    $colon_position = strpos($line,':');
    // check if there is colon in line
    if ($colon_position === false)
    {
        return NULL;
    }
    $key = substr( $line, 0, $colon_position );
    $value = substr ( $line, $colon_position + 1 );
    while ( strpos($value, " ") === 0 )
    {
        $value = substr ( $value, 1 );
    }
    return [ $key => $value ];
}
Petrb (talk)15:33, 10 January 2014

This doesn't look like a FFS to me, anyway please commit patches on gerrit.

Nemo (talk)15:34, 10 January 2014

no this is php.

anyway, where can I find documentation for that FFS format you talk about? this piece of french text isn't very self-describing. Thanks!

Petrb (talk)15:36, 10 January 2014

Petrb, are you still interested in working on this? Were the links above to other FFS not useful? Let us know if you get stuck at some point with the gerrit patches in Translate/translatewiki repos.

Nemo (talk)11:46, 21 February 2014

it seems easier if we just change the format to something what is sane and easy to parse, so from current list of formats supported by this extension, only properly supported format I found was XML, so I would probably go for that. What is next step, you can assume all our language files are XML now.

Petrb (talk)15:09, 24 April 2014