Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.0.0 - Missing words #289

Closed
Richard-Tang opened this issue Oct 28, 2021 · 12 comments
Closed

v3.0.0 - Missing words #289

Richard-Tang opened this issue Oct 28, 2021 · 12 comments
Labels
bug Something isn't working

Comments

@Richard-Tang
Copy link

Richard-Tang commented Oct 28, 2021

Describe the bug
2.7.3 ---> normal
3.0.0 ---> missing words

To Reproduce

import com.github.weisj.darklaf.LafManager;

import javax.swing.*;

public class Main {

    public static void main(String[] args) {
        LafManager.install();
        
        JFrame jFrame = new JFrame();
        jFrame.setSize(600, 600);
        jFrame.setVisible(true);

        JButton jButton = new JButton("123");
        JPanel  jPanel  = new JPanel();
        jFrame.add(jPanel);
        jPanel.add(jButton);

        jButton.addActionListener(e -> {
            JFileChooser jFileChooser = new JFileChooser();
            jFileChooser.showOpenDialog(null);
        });
    }
}

Screenshots
image

image

Additional Information:

  • OS: MacOS Big Sur
  • OS Version: 11.6
  • Darklaf Version: 2.7.3 And 3.0.0
  • JDK Version
openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment JBR-11.0.12.7-1729.1-jcef (build 11.0.12+7-b1729.1)
OpenJDK 64-Bit Server VM JBR-11.0.12.7-1729.1-jcef (build 11.0.12+7-b1729.1, mixed mode)

Additional context

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>untitled</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.github.weisj</groupId>
            <artifactId>darklaf-core</artifactId>
            <version>2.7.3</version>
        </dependency>
    </dependencies>

</project>

In addition, I would like to add another question, can the English letters "Open" "Cancel" here be changed into other languages?

@Richard-Tang Richard-Tang added the bug Something isn't working label Oct 28, 2021
@weisJ
Copy link
Owner

weisJ commented Oct 29, 2021

Thank you for reporting this issue. This is happening because internal resource bundles can no longer be added from outside jdk modules. I am working on a solution for this.

In addition, I would like to add another question, can the English letters "Open" "Cancel" here be changed into other languages?

This can be accomplished by changing the default locale:
https://docs.oracle.com/javase/8/docs/api/index.html?java/util/Locale.html

@weisJ
Copy link
Owner

weisJ commented Jan 7, 2022

Reopened because of #298 (comment)

@weisJ weisJ reopened this Jan 7, 2022
@weisJ
Copy link
Owner

weisJ commented Jan 8, 2022

@Xujiayao I'm not quite able to reproduce the missing resources. Could you check for me using a debugger what values are contained in the private Vector<String> resourceBundles field of UIManager.getLookAndFeelDefaults() after installing the laf?

@Xujiayao
Copy link
Contributor

Xujiayao commented Jan 9, 2022

Could you check for me using a debugger what values are contained in the private Vector<String> resourceBundles field of UIManager.getLookAndFeelDefaults() after installing the laf?

Can you give a sample code and where should breakpoints be set for that? I tried but resourceBundles is always null. 🤔

@weisJ
Copy link
Owner

weisJ commented Jan 9, 2022

SwingUtilities.invokeLater(() -> {
    LafManager.install(new IntelliJTheme());
    UIDefaults defaults = UIManager.getLookAndFeelDefaults();
});

Should do the trick. Then inspect defaults.resourceBundles.

@Xujiayao
Copy link
Contributor

Xujiayao commented Jan 9, 2022

Like this?

image

@weisJ
Copy link
Owner

weisJ commented Jan 9, 2022

Yes exactly thank you :)

@Xujiayao
Copy link
Contributor

Xujiayao commented Jan 9, 2022

Ok. Thank you for your hard work! 👍

@weisJ
Copy link
Owner

weisJ commented Feb 2, 2022

Sorry I didn't get back to you sooner. This seems very wird to me. All necessey resource bundles are loaded and they do contain the missing strings. I'll have to do some more investigation to find out why this is happening. What jdk version/dsitribution do you use?

@Xujiayao
Copy link
Contributor

Xujiayao commented Feb 3, 2022

JDK Version: (Oracle)

java version "17.0.1" 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)

I just re-tried inspect defaults.resourceBundles:

image

@weisJ weisJ closed this as completed in ff34a3e Feb 12, 2022
@weisJ
Copy link
Owner

weisJ commented Feb 12, 2022

I was able to reproduce the issue and fixed it with the latest snapshot.

@Xujiayao
Copy link
Contributor

Just tested and it's fixed. This has helped me a lot in my modular project. Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants