Compare commits

..

12 Commits

Author SHA1 Message Date
5319e18fb5 Merge pull request #309 from ONLYOFFICE/release/1.4.0
Release/1.4.0
2022-11-08 16:37:37 +03:00
6054bffb3f Merge pull request #305 from ONLYOFFICE/dependabot/maven/web/documentserver-example/java-spring/com.fasterxml.jackson.core-jackson-databind-2.13.4.1
build(deps): bump jackson-databind from 2.12.6.1 to 2.13.4.1 in /web/documentserver-example/java-spring
2022-11-08 10:31:57 +03:00
30481005a1 removed enum Language (Fix Bug 59624) 2022-11-08 09:17:30 +03:00
5544768500 set language from cookies (Fix Bug 59352) 2022-11-08 09:17:22 +03:00
14e53970c8 update pyjwt=2.6.0 (Fix Bug 59369) 2022-11-08 09:16:37 +03:00
2b184972dc Merge pull request #306 from ONLYOFFICE/dependabot/bundler/web/documentserver-example/ruby/nokogiri-1.13.9
build(deps): bump nokogiri from 1.13.8 to 1.13.9 in /web/documentserver-example/ruby
2022-11-03 14:46:55 +03:00
0fb9da4d89 update pom.xml 2022-11-03 14:11:05 +03:00
1593df6aec build(deps): bump nokogiri in /web/documentserver-example/ruby
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.8 to 1.13.9.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.8...v1.13.9)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-26 10:46:51 +00:00
16584c0abb Merge remote-tracking branch 'remotes/origin/hotfix/1.3.1' into release/1.4.0
# Conflicts:
#	CHANGELOG.md
#	web/documentserver-example/csharp/settings.config
#	web/documentserver-example/ruby/config/application.rb
2022-10-26 13:39:29 +03:00
1ddda89001 Merge pull request #307 from ONLYOFFICE/hotfix/1.3.1
Hotfix/1.3.1
2022-10-26 13:37:19 +03:00
5b76d798fb 1.3.1 2022-10-26 13:28:18 +03:00
59e17079ff build(deps): bump jackson-databind
Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.12.6.1 to 2.13.4.1.
- [Release notes](https://github.com/FasterXML/jackson/releases)
- [Commits](https://github.com/FasterXML/jackson/commits)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-19 07:08:15 +00:00
10 changed files with 58 additions and 70 deletions

View File

@ -6,6 +6,10 @@
- offline viewer for anonymous
- added hy, eu, zh-TW, ms, pt-PT
## 1.3.1
- charp: fix references
- ruby: update rails
## 1.3.0
- update empty files
- anonymous without chat

View File

@ -61,10 +61,15 @@
<version>1.18.20</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.13.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.6.1</version>
<version>2.13.4.2</version>
</dependency>
<dependency>
<groupId>org.modelmapper</groupId>

View File

@ -26,7 +26,6 @@ import com.onlyoffice.integration.documentserver.models.enums.Action;
import com.onlyoffice.integration.documentserver.storage.FileStoragePathBuilder;
import com.onlyoffice.integration.entities.User;
import com.onlyoffice.integration.dto.Mentions;
import com.onlyoffice.integration.documentserver.models.enums.Language;
import com.onlyoffice.integration.documentserver.models.enums.Type;
import com.onlyoffice.integration.documentserver.models.filemodel.FileModel;
import com.onlyoffice.integration.services.UserServices;
@ -53,6 +52,9 @@ public class EditorController {
@Value("${files.docservice.url.api}")
private String docserviceApiUrl;
@Value("${files.docservice.languages}")
private String langs;
@Autowired
private FileStoragePathBuilder storagePathBuilder;
@ -82,11 +84,19 @@ public class EditorController {
Model model) throws JsonProcessingException {
Action action = Action.edit;
Type type = Type.desktop;
Language language = Language.en;
Locale locale = new Locale("en");
if(actionParam != null) action = Action.valueOf(actionParam);
if(typeParam != null) type = Type.valueOf(typeParam);
if(lang != null) language = Language.valueOf(lang);
List<String> langsAndKeys = Arrays.asList(langs.split("\\|"));
for (String langAndKey : langsAndKeys) {
String[] couple = langAndKey.split(":");
if (couple[0].equals(lang)) {
String[] langAndCountry = couple[0].split("-");
locale = new Locale(langAndCountry[0], langAndCountry.length > 1 ? langAndCountry[1] : "");
}
}
Optional<User> optionalUser = userService.findUserById(Integer.parseInt(uid));
@ -101,7 +111,7 @@ public class EditorController {
.builder()
.fileName(fileName)
.type(type)
.lang(language)
.lang(locale.toLanguageTag())
.action(action)
.user(user)
.actionData(actionLink)

View File

@ -1,55 +0,0 @@
/**
*
* (c) Copyright Ascensio System SIA 2021
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.onlyoffice.integration.documentserver.models.enums;
public enum Language {
en,
de,
ru,
pl,
be,
bg,
ca,
zh,
cs,
da,
nl,
fi,
fr,
el,
hu,
id,
it,
ja,
ko,
lv,
lo,
nb,
pt,
ro,
sk,
sl,
sv,
es,
tr,
uk,
vi,
gl,
az
}

View File

@ -20,7 +20,6 @@ package com.onlyoffice.integration.documentserver.models.filemodel;
import com.onlyoffice.integration.documentserver.models.configurations.Customization;
import com.onlyoffice.integration.documentserver.models.configurations.Embedded;
import com.onlyoffice.integration.documentserver.models.enums.Language;
import com.onlyoffice.integration.documentserver.models.enums.Mode;
import lombok.*;
import org.springframework.beans.factory.annotation.Autowired;
@ -44,7 +43,7 @@ public class EditorConfig { // the parameters pertaining to the editor interfac
private Customization customization; // the parameters which allow to customize the editor interface so that it looked like your other products (if there are any) and change the presence or absence of the additional buttons, links, change logos and editor owner details
@Autowired
private Embedded embedded; // the parameters which allow to change the settings which define the behavior of the buttons in the embedded mode
private Language lang; // the editor interface language
private String lang; // the editor interface language
private Mode mode; // the editor opening mode
@Autowired
private User user; // the user currently viewing or editing the document

View File

@ -20,7 +20,6 @@ package com.onlyoffice.integration.services.configurers.wrappers;
import com.onlyoffice.integration.documentserver.models.enums.Action;
import com.onlyoffice.integration.entities.User;
import com.onlyoffice.integration.documentserver.models.enums.Language;
import com.onlyoffice.integration.documentserver.models.enums.Type;
import lombok.Builder;
import lombok.Getter;
@ -33,7 +32,7 @@ public class DefaultFileWrapper {
private String fileName;
private Type type;
private User user;
private Language lang;
private String lang;
private Action action;
private String actionData;
private Boolean canEdit;

View File

@ -318,8 +318,19 @@
<script type="text/javascript" src="scripts/jscript.js"></script>
<script type="text/javascript" src="scripts/converter.js"></script>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function(){
document.getElementById("language").value="en";
document.addEventListener('DOMContentLoaded', function() {
var lang = document.cookie
.split('; ')
.find((row) => row.startsWith('ulang='))
?.split('=')[1];
var languages = Array.from(document.getElementById("language").options).map(e => e.value)
if (!languages.includes(lang)) {
lang = "en";
}
document.getElementById("language").value=lang;
});
</script>
</body>

View File

@ -349,8 +349,19 @@
var UrlConverter = "IndexServlet?type=convert";
var UrlEditor = "EditorServlet";
document.addEventListener('DOMContentLoaded', function(){
document.getElementById("language").value="en";
document.addEventListener('DOMContentLoaded', function() {
var lang = document.cookie
.split('; ')
.find((row) => row.startsWith('ulang='))
?.split('=')[1];
var languages = Array.from(document.getElementById("language").options).map(e => e.value)
if (!languages.includes(lang)) {
lang = "en";
}
document.getElementById("language").value=lang;
});
</script>
</body>

View File

@ -35,7 +35,7 @@ See the detailed guide to learn how to install Document Server [for Windows](htt
```
pip install Django==3.1.3
pip install requests==2.25.0
pip install pyjwt==2.3.0
pip install pyjwt==2.6.0
pip install python-magic
```

View File

@ -88,6 +88,7 @@ GEM
digest (3.1.0)
erubi (1.11.0)
execjs (2.8.1)
ffi (1.15.5)
ffi (1.15.5-x64-mingw-ucrt)
globalid (1.0.0)
activesupport (>= 5.0)
@ -127,7 +128,9 @@ GEM
net-protocol
timeout
nio4r (2.5.8)
nokogiri (1.13.8-x64-mingw-ucrt)
nokogiri (1.13.9-x64-mingw-ucrt)
racc (~> 1.4)
nokogiri (1.13.9-x86_64-linux)
racc (~> 1.4)
psych (4.0.5)
stringio
@ -216,6 +219,7 @@ GEM
PLATFORMS
x64-mingw-ucrt
x86_64-linux
DEPENDENCIES
byebug