Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marcus Eibrink-Lunzenauer
Stud.IP
Commits
84baca6b
Commit
84baca6b
authored
2 years ago
by
Jan-Hendrik Willms
Browse files
Options
Downloads
Patches
Plain Diff
fix non translatable strings in mvv diff log, fixes #997
Closes #997
parent
ec20fa61
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
resources/assets/javascripts/bootstrap/mvv_difflog.js
+16
-8
16 additions, 8 deletions
resources/assets/javascripts/bootstrap/mvv_difflog.js
resources/assets/javascripts/lib/gettext.js
+2
-1
2 additions, 1 deletion
resources/assets/javascripts/lib/gettext.js
with
18 additions
and
9 deletions
resources/assets/javascripts/bootstrap/mvv_difflog.js
+
16
−
8
View file @
84baca6b
import
{
$gettextInterpolate
}
from
'
../lib/gettext.js
'
;
STUDIP
.
domReady
(()
=>
{
STUDIP
.
domReady
(()
=>
{
$
(
'
del.diffdel
'
).
each
(
function
()
{
$
(
'
del.diffdel
'
).
each
(
function
()
{
var
mvv_field
=
''
;
var
mvv_field
=
''
;
...
@@ -40,9 +42,9 @@ STUDIP.domReady(() => {
...
@@ -40,9 +42,9 @@ STUDIP.domReady(() => {
senddata
,
senddata
,
function
(
data
)
{
function
(
data
)
{
if
(
data
)
{
if
(
data
)
{
var
info
=
'
Entfernt von
'
+
data
.
user
+
'
am
'
+
data
.
time
;
var
info
=
$gettextInterpolate
(
'
Entfernt von %{user} am %{time}
'
,
data
)
;
del
.
attr
(
'
title
'
,
info
);
del
.
attr
(
'
title
'
,
info
);
del
.
after
(
'
<del class="difflog"
> [
'
+
info
+
'
] </ins>
'
);
$
(
'
<del class="difflog"
/>
'
).
text
(
` [
${
info
}
] `
).
insertAfter
(
del
);
}
}
},
},
'
json
'
'
json
'
...
@@ -131,9 +133,9 @@ STUDIP.domReady(() => {
...
@@ -131,9 +133,9 @@ STUDIP.domReady(() => {
senddata
,
senddata
,
function
(
data
)
{
function
(
data
)
{
if
(
data
)
{
if
(
data
)
{
var
info
=
'
Änderung durch
'
+
data
.
user
+
'
am
'
+
data
.
time
;
var
info
=
$gettextInterpolate
(
'
Änderung durch %{user} am %{time}
'
,
data
)
;
ins
.
attr
(
'
title
'
,
info
);
ins
.
attr
(
'
title
'
,
info
);
ins
.
after
(
'
<ins class="difflog"
> [
'
+
info
+
'
] </
ins
>
'
);
$
(
'
<ins class="difflog"
/>
'
).
text
(
` [
${
info
}
] `
).
insertAfter
(
ins
);
}
}
},
},
'
json
'
'
json
'
...
@@ -160,9 +162,12 @@ STUDIP.domReady(() => {
...
@@ -160,9 +162,12 @@ STUDIP.domReady(() => {
{
mvv_field
:
'
mvv_
'
+
mvv_type
,
mvv_id
:
mvv_id
,
log_action
:
'
new
'
},
{
mvv_field
:
'
mvv_
'
+
mvv_type
,
mvv_id
:
mvv_id
,
log_action
:
'
new
'
},
function
(
data
)
{
function
(
data
)
{
if
(
data
)
{
if
(
data
)
{
var
info
=
'
Hinzugefügt von
'
+
data
.
user
+
'
am
'
+
data
.
time
;
var
info
=
$gettextInterpolate
(
'
Hinzugefügt von %{user} am %{time}
'
,
data
)
;
curtable
.
attr
(
'
title
'
,
info
);
curtable
.
attr
(
'
title
'
,
info
);
curtable
.
append
(
'
<tr><td><ins class="difflog"> [
'
+
info
+
'
] </ins><td></tr>
'
);
const
log
=
$
(
'
<ins class="difflog"/>
'
).
text
(
` [
${
info
}
] `
);
const
cell
=
$
(
'
<td/>
'
).
append
(
log
);
const
row
=
$
(
'
<tr/>
'
).
append
(
cell
);
curtable
.
append
(
row
);
}
}
},
},
'
json
'
'
json
'
...
@@ -188,9 +193,12 @@ STUDIP.domReady(() => {
...
@@ -188,9 +193,12 @@ STUDIP.domReady(() => {
{
mvv_field
:
'
mvv_
'
+
mvv_type
,
mvv_id
:
mvv_id
,
log_action
:
'
del
'
},
{
mvv_field
:
'
mvv_
'
+
mvv_type
,
mvv_id
:
mvv_id
,
log_action
:
'
del
'
},
function
(
data
)
{
function
(
data
)
{
if
(
data
)
{
if
(
data
)
{
var
info
=
'
Entfernt von
'
+
data
.
user
+
'
am
'
+
data
.
time
;
var
info
=
$gettextInterpolate
(
'
Entfernt von %{user} am %{time}
'
,
data
)
;
curtable
.
attr
(
'
title
'
,
info
);
curtable
.
attr
(
'
title
'
,
info
);
curtable
.
append
(
'
<tr><td><del class="difflog"> [
'
+
info
+
'
] </del><td></tr>
'
);
const
log
=
$
(
'
<del class="difflog"/>
'
).
text
(
` [
${
info
}
] `
);
const
cell
=
$
(
'
<td/>
'
).
append
(
log
);
const
row
=
$
(
'
<tr/>
'
).
append
(
cell
);
curtable
.
append
(
row
);
}
}
},
},
'
json
'
'
json
'
...
...
This diff is collapsed.
Click to expand it.
resources/assets/javascripts/lib/gettext.js
+
2
−
1
View file @
84baca6b
...
@@ -8,8 +8,9 @@ const DEFAULT_LANG_NAME = 'Deutsch';
...
@@ -8,8 +8,9 @@ const DEFAULT_LANG_NAME = 'Deutsch';
const
state
=
getInitialState
();
const
state
=
getInitialState
();
const
$gettext
=
translate
.
gettext
.
bind
(
translate
);
const
$gettext
=
translate
.
gettext
.
bind
(
translate
);
const
$gettextInterpolate
=
translate
.
gettextInterpolate
.
bind
(
translate
);
export
{
$gettext
,
translate
,
getLocale
,
setLocale
,
getVueConfig
};
export
{
$gettext
,
$gettextInterpolate
,
translate
,
getLocale
,
setLocale
,
getVueConfig
};
function
getLocale
()
{
function
getLocale
()
{
return
state
.
locale
;
return
state
.
locale
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment