Bug 120141 - Templates in shellnew directory not fitting to global settings
Summary: Templates in shellnew directory not fitting to global settings
Status: RESOLVED DUPLICATE of bug 139962
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: All Windows (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-26 19:05 UTC by Bernhard
Modified: 2022-08-12 06:48 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bernhard 2018-09-26 19:05:10 UTC
I did the following:
1. Change of the global settings "standard document language" and "standard template".
2. Creating a new document by using the context menu of the windows explorer.

Expected behaviour:
New file is according to the global lo-settings as mentioned above.

Current behaviour:
The new file is a standard file created once in the installation process.

Workaround: I replaced the files in the folder share\template\shellnew according to my presonal preferences.

Comment: The solution of this might also resolve Bug 94857.
Comment 1 Buovjaga 2018-10-23 17:30:02 UTC
(In reply to Bernhard from comment #0)
> I did the following:
> 1. Change of the global settings "standard document language" and "standard
> template".
> 2. Creating a new document by using the context menu of the windows explorer.

No problem here.

Tools - Options - Language settings - Languages - Default languages for documents: changed from Finnish to Dibole.

Win explorer produces Dibole documents.

Version: 6.1.2.1 (x64)
Build ID: 65905a128db06ba48db947242809d14d3f9a93fe
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: fi-FI (fi_FI); Calc: group threaded
Comment 2 Bernhard 2018-11-01 12:15:03 UTC
(In reply to Buovjaga from comment #1)
> (In reply to Bernhard from comment #0)
> > I did the following:
> > 1. Change of the global settings "standard document language" and "standard
> > template".
> > 2. Creating a new document by using the context menu of the windows explorer.
> 
> No problem here.
> 
> Tools - Options - Language settings - Languages - Default languages for
> documents: changed from Finnish to Dibole.
> 
> Win explorer produces Dibole documents.
> 
> Version: 6.1.2.1 (x64)
> Build ID: 65905a128db06ba48db947242809d14d3f9a93fe
> CPU threads: 4; OS: Windows 10.0; UI render: default; 
> Locale: fi-FI (fi_FI); Calc: group threaded

I just updated to 6.1.2.1
Documents in templates folder C:\Program Files\LibreOffice\share\template\shellnew were overwritten by installation program with english templates.

Problem persists. In other words:
Changing standard language does not change documents in templates folder.
Win explorer takes the documents from that folder as template for new documents.

Question: Could you please check, whether the changing of the standard language does result in a changed template in the templates folder?
Comment 3 Buovjaga 2018-11-01 14:25:25 UTC
I already tried. If there is something I misunderstood, you must provide clearer and *exact* steps to reproduce this.

Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the information.
Comment 4 Alcyone 2019-04-03 09:07:45 UTC
(In reply to Buovjaga from comment #3)
> I already tried. If there is something I misunderstood, you must provide
> clearer and *exact* steps to reproduce this.
> 
> Set to NEEDINFO.
> Change back to UNCONFIRMED after you have provided the information.

(I can't speak English well but try to explain.)

I think the steps to reproduce is exactly written in comment#0. As long as I know, this annoying behavior has not changed since LibreOffice ver.4.0x.

Now, in LibreOffice ver.6.x, All Japanese users' setting of "standard language for documents" is "US-EN" for western languages and "Simplified Chinese" for Asian languages whenever they create any document from windows explorer's context menu(shellnew).

Not only the language setting but all settings of LibreOffice is applied by "shellnew template files" when you create the file with using shellnew. And LibreOffice has no command for changing "shell new template files". So, you can find that last updated date of "shell new template files" has been not changed since the day LibreOffice installed. This is clearly the fatal lack of function.

* I mean "shellnew template files" is the 4 files (soffice.odg, .odp, .ods, .odt) where are (installed folder)/LibreOffice/share/template/shellnew.
Comment 5 Nikolaus Kühn 2020-01-04 22:12:04 UTC Comment hidden (obsolete)
Comment 6 Nikolaus Kühn 2020-01-04 22:14:01 UTC
Hi, 

I have just reproduced this on my partner's new windows 10 computer (fresh windowsn installation). 

 - Windows 10 64bit, latest version and updates
 - German (Germany) locale in the windows system

Since you asked for a more precise reproduction flow @Buovjaga: 

 * download libreoffice https://www.libreoffice.org/download/download/ (latest, tested with 6.3.4)
 * run installer, leave all standard settings
 * start libreoffice writer from start menu
 * type "Rice  Reis"  ("reis" is german for rice)  -> "rice" underlined by spell checker, i.e. libreoffice finds the english spellling not OK but the german one OK.
 * close libreoffice
 * open windows explorer
 * navigate to documents folder
 * right click/tap in folder, choose "Neu -> OpenDocument Text" in context menu ("neu" is german for "new")
 * type a file name, press return
 * double click the file, opens in libreoffice
 * type "Rice Reis"  -> "Reis" underlined by spell checker, i.e. libreoffice finds the german spelling not OK but the english one OK. 

Expected behavior in last step: "Rice" underlined in spell checker because all defaults should be properly set to the system locale on a fresh install. 

I chose the spell checker because it's an obviously visible use case. But the document created via the context menu in the explorer is overall not set to the standard locale. 

---

My guess / gut feeling about the issue:
The problem is that creating a new file via the context menu in the windows explorer is happening without any software interaction with libreoffice. Windows solely relies on the registry information to decide what file to copy and create. 

"Computer\HKEY_CLASSES_ROOT\.odt\LibreOffice.WriterDocument.1\ShellNew\FileName"  contains the path to the Libreoffice installation folder and the the libreoffice installer is not language-specific, libreoffice handles locale defaults at first start but does not change the file in the installation folder (which is hard because changing them requires administrator privileges). 

Maybe LO could put a file into the installation folder's "share\template\shellnew" that is somemarked as unlocalized so it can detect that when opening the file and set the configured locale when the file is first opened (which would again have the downside that the file is changed and the user would have to save even if nothing is changed).  

Not sure how other applications handle the case. 

This issue could be tagged with a 6.x version istead of 4.x to increase visibility.
Comment 7 Nikolaus Kühn 2020-01-04 22:17:17 UTC
(In reply to Nikolaus Kühn from comment #6)
  
> This issue could be tagged with a 6.x version istead of 4.x to increase
> visibility.

Please ignore that statement, I forgot that the version tag refers to the earliest affected
Comment 8 Bernhard 2020-01-05 23:16:26 UTC
(In reply to Nikolaus Kühn from comment #6)

> Not sure how other applications handle the case. 

From other applications I know the following solution:

Right-click function in the explorer just creates an empty (0 Bytes) file.
The applications generates the propper file as soon as you open it.

regards
Bernhard
Comment 9 Nikolaus Kühn 2020-01-06 21:04:51 UTC
(In reply to Bernhard from comment #8)
> > Not sure how other applications handle the case. 
> 
> From other applications I know the following solution:

I just tested MS Office 2010, it does an interesting mix.  
 * A new Word File is an empty file
 * a new Powerpoint file is an actual presentation XSLX including my user as the creator and the actual creation date in the metadata inside the generated zipped archive XSLX
 * a new Excel file is an actual spreadsheet with my user as the creator but some 2006 date as the creation date in the created metadata. 

Not very insightful but the powerpoint file shows that there seems to be a way to dynamically do something inside a file when it's created.  

In the registry, Word doesn't have a "FileName" Value, it has an empty "NullFile" value only which seems to trigger windows to create an empty file. PPTX has a "FileName" value which just contains "pwrpnt12.pptx" (not a full path, not sure what that means).
Comment 10 QA Administrators 2022-06-05 03:40:23 UTC Comment hidden (obsolete)
Comment 11 Dieter 2022-08-12 06:48:13 UTC
Tested with

Version: 7.3.5.2 (x64) / LibreOffice Community
Build ID: 184fe81b8c8c30d8b5082578aee2fed2ea847c01
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

Actual result:
New document has default document language
New document doesn't have a template

Expected result
New document has default document language
New document should use the default template

=> First problem mentioned in original report is fixed, seco nd probelm still remains
=> This is bug 139962

*** This bug has been marked as a duplicate of bug 139962 ***