Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
16cb266c
Commit
16cb266c
authored
Dec 27, 2009
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experimental lua gettext support.
parent
60a57b83
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
1 deletion
+81
-1
modules/misc/lua/Modules.am
modules/misc/lua/Modules.am
+1
-0
modules/misc/lua/intf.c
modules/misc/lua/intf.c
+1
-0
modules/misc/lua/libs.h
modules/misc/lua/libs.h
+1
-0
modules/misc/lua/libs/gettext.c
modules/misc/lua/libs/gettext.c
+74
-0
share/lua/intf/rc.lua
share/lua/intf/rc.lua
+4
-1
No files found.
modules/misc/lua/Modules.am
View file @
16cb266c
...
...
@@ -7,6 +7,7 @@ SOURCES_lua = \
libs.h \
libs/acl.c \
libs/configuration.c \
libs/gettext.c \
libs/httpd.c \
libs/input.c \
libs/input.h \
...
...
modules/misc/lua/intf.c
View file @
16cb266c
...
...
@@ -211,6 +211,7 @@ int Open_LuaIntf( vlc_object_t *p_this )
luaopen_video
(
L
);
luaopen_vlm
(
L
);
luaopen_volume
(
L
);
luaopen_gettext
(
L
);
/* clean up */
lua_pop
(
L
,
1
);
...
...
modules/misc/lua/libs.h
View file @
16cb266c
...
...
@@ -42,5 +42,6 @@ void luaopen_variables( lua_State * );
void
luaopen_video
(
lua_State
*
);
void
luaopen_vlm
(
lua_State
*
);
void
luaopen_volume
(
lua_State
*
);
void
luaopen_gettext
(
lua_State
*
);
#endif
modules/misc/lua/libs/gettext.c
0 → 100644
View file @
16cb266c
/*****************************************************************************
* gettext.c
*****************************************************************************
* Copyright (C) 2009 the VideoLAN team
* $Id$
*
* Authors: Antoine Cellerier <dionoea at videolan tod org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_fixups.h>
#include <lua.h>
/* Low level lua C API */
#include <lauxlib.h>
/* Higher level C API */
#include <lualib.h>
/* Lua libs */
#include "../vlc.h"
#include "../libs.h"
/*****************************************************************************
* Libvlc gettext support
*****************************************************************************/
static
int
vlclua_gettext
(
lua_State
*
L
)
{
lua_pushstring
(
L
,
_
(
luaL_checkstring
(
L
,
1
)
)
);
return
1
;
}
static
int
vlclua_gettext_noop
(
lua_State
*
L
)
{
(
void
)
L
;
return
1
;
}
/*****************************************************************************
*
*****************************************************************************/
static
const
luaL_Reg
vlclua_gettext_reg
[]
=
{
{
"_"
,
vlclua_gettext
},
{
"N_"
,
vlclua_gettext_noop
},
{
NULL
,
NULL
}
};
void
luaopen_gettext
(
lua_State
*
L
)
{
lua_newtable
(
L
);
luaL_register
(
L
,
NULL
,
vlclua_gettext_reg
);
lua_setfield
(
L
,
-
2
,
"gettext"
);
}
share/lua/intf/rc.lua
View file @
16cb266c
...
...
@@ -61,12 +61,15 @@ skip2 = function(foo) return skip(skip(foo)) end
setarg
=
common
.
setarg
strip
=
common
.
strip
_
=
vlc
.
gettext
.
_
N_
=
vlc
.
gettext
.
N_
--[[ Setup default environement ]]
env
=
{
prompt
=
"> "
;
width
=
70
;
autocompletion
=
1
;
autoalias
=
1
;
welcome
=
"Remote control interface initialized. Type `help' for help."
;
welcome
=
_
(
"Remote control interface initialized. Type `help' for help."
)
;
flatplaylist
=
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment