Add code to use OpenAI API to do transalations

This commit is contained in:
2024-06-13 16:38:25 +01:00
parent a5f8e153a2
commit d1ab8b4256
38 changed files with 1258 additions and 477 deletions

View File

@@ -7,10 +7,9 @@ package SrvMngr::Controller::${PackageName};
# description : ${MenuDescription}
# navigation : ${MenuNavigation}
#
# name : ${lcPackageName}, method : get, url : /${lcPackageName}, ctlact : ${lcPackageName}#main
# name : ${lcPackageName}u, method : post, url : /${lcPackageName}u, ctlact : ${lcPackageName}#do_update
# name : ${lcPackageName}d, method : get, url : /${lcPackageName}d, ctlact : ${lcPackageName}#do_display
# name : ${lcPackageName}e, method : post, url : /${lcPackageName}d, ctlact : ${lcPackageName}#do_display
# name : ${lcPackageName}, method : get, url : /${lcPackageName}, ctlact : ${PackageName}#main
# name : ${lcPackageName}u, method : post, url : /${lcPackageName}u, ctlact : ${PackageName}#do_update
# name : ${lcPackageName}d, method : get, url : /${lcPackageName}d, ctlact : ${PackageName}#do_display
#
# routes : end
#
@@ -89,7 +88,7 @@ sub main {
modul => $modul,
${prefix}_data => \%${prefix}_data
);
$c->render( template => "${PackageName}" );
$c->render( template => "${lcPackageName}" );
}
# Post request with params - submit from the form
@@ -164,7 +163,7 @@ sub do_update {
$c->stash(error => $c->l($ret));
$c->render("${PackageName}");
} else {
$c->stash( success => $c->l('${panel} panel action was successfull')); #A bit bland - edit it in the lex file
$c->stash( success => $c->l('${panel} panel action was successful')); #A bit bland - edit it in the lex file
}
}
</tal:block>

View File

@@ -1,5 +1,5 @@
#
# Routines to be editted by the developer to provide validation for parameters
# Routines to be edited by the developer to provide validation for parameters
# and provison of the control data for table(s)
#
# Generated by ${version}

View File

@@ -1,9 +1,9 @@
<root>
<Text><![CDATA[
<p><span class=label>
%=l('${prefix}_${Label}'), class => 'label'
%=l('${prefix}_${Label}')
</span><span class=data>
%= ${Value}, class => 'data'
%= ${Value}
</span></p>
]]></Text>
@@ -92,7 +92,7 @@
</email>
<password><![CDATA[
<p><span class=label>
<p><span class='label'>
%=l('${Label}')
</span><span class=data>
</span>span></p>
@@ -100,17 +100,17 @@
</password>
<Table><![CDATA[
<br /><table class="sme-border TableSort">
<br /><table class="sme-border TableSort sme-table">
<thead>
<tr><tal:block tal:repeat="ColHead TopHeadings">
<th class='sme-border'><%=l('${ColHead}')%></th></tal:block>
<tr table-head-row><tal:block tal:repeat="ColHead TopHeadings">
<th class='sme-border table-head-col table-head-col-${ColHead} '><%=l('${ColHead}')%></th></tal:block>
</tr>
</thead>
<tbody>
% my $control_data = $self->stash('${TableControl}');
% foreach my $row (@$control_data) {
<tr><tal:block tal:repeat="ColContent Columns">
<td class='sme-border'><%=$c->render_to_string(inline=>$row->{${ColContent}})%></td></tal:block>
<tr class='table-row'><tal:block tal:repeat="ColContent Columns">
<td class='sme-border table-col table-col-${ColContent}'><%=$c->render_to_string(inline=>$row->{${ColContent}})%></td></tal:block>
</tr>
%}
</tbody>

View File

@@ -1,7 +1,7 @@
%#
%# Generated by ${version}
%#
<div id="${PackageName}-${route}">
<div id="${PackageName}-${route}" class="partial ${PackageName}-${route}">
<script>
window.onload = function() {
SelectInput();
@@ -17,5 +17,5 @@
%= hidden_field 'trt' => $$${prefix}_data->{trt}
%# Inputs etc in here.
%# Probably finally by a submit.
% end
%end
</div>